/// <summary> /// If we have chosen a target we add the card to the target. /// Otherwise we kill the card and add it back to the player's hand /// </summary> public override void Die() { base.Die(); if (ShipChosen) { // We have clicked on the target we were hovering over so we are good to go // Add the card to the ship we have selected DebugUtils.AssertNotNull(Target); (CardToChooseTargetFor.Parent as CardObjectPair).AddToCardShipPair(Target); } else { // The command has ended, but we have not chosen a ship // Therefore we must send the card back to our hand and refund the resources BattleScreen.ActivePlayer.AddCardToHand(CardToChooseTargetFor); BattleScreen.ActivePlayer.AlterResources(CardToChooseTargetFor, ChargeType.kRefund); CardToChooseTargetFor.Die(); } }
/// <summary> /// A function which returns whether the card we are looking to use can be used on the current target /// </summary> /// <param name="cardToChooseTargetFor"></param> /// <param name="currentTarget"></param> /// <returns></returns> private bool ValidIfCanUseOn(CardShipPair currentTarget) { return(CardToChooseTargetFor.CanUseOn(currentTarget)); }