using RobotAndDonkey.Game.Cards; using RobotAndDonkey.Game.Execution.Results; using RobotAndDonkey.Game.GameState; namespace RobotAndDonkey.Game.Intents; public class DestroyCard(Card card) : CardIntent(card) { public override void Run(Guid requestId, CoreLoop coreLoop, List newIntents, List results) { coreLoop.RemoveProgramCard(Card); var handCards = coreLoop.GetHandCards(); coreLoop.PatchDeck.AddRange(handCards); foreach (var handCard in handCards) { coreLoop.RemoveProgramCard(handCard); } coreLoop.ClearTapeSelection(); results.Add(new ProgramRowResult(requestId, coreLoop.ProgramRow.ToArray(), coreLoop.TapeCardIds)); results.Add(new DeckResult(requestId, coreLoop.PatchDeck.ToArray())); results.Add(new HandResult(requestId, coreLoop.Hand.ToArray())); base.Run(requestId, coreLoop, newIntents, results); } public override bool Immune => true; public override string ToString() => $"Destroy {Card.Name}, " + base.ToString(); }