internal CardInstance Clone(Player owner)
        {
            var clonedCard = new CardInstance
            {
                Model = Model,
                Owner = owner,
                Guid = Guid,
                Zone = Zone
            };

            clonedCard.Behaviors.Capacity = Behaviors.Capacity;
            for (int i = 0; i < Behaviors.Count; ++i)
            {
                var bhv = Behaviors[i];
                clonedCard.Behaviors.Add(bhv.IsStatic ? bhv : (bhv.Model as Behaviors.IInternalBehaviorModel).Instantiate());
            }

            clonedCard.m_counters.Capacity = m_counters.Capacity;
            foreach (var item in m_counters)
            {
                clonedCard.m_counters.Add(item);
            }

            return clonedCard;
        }
 internal void TransferFrom(CardInstance original)
 {
     for (int i = 0; i < Behaviors.Count; ++i)
     {
         var bhv = Behaviors[i];
         if (!bhv.IsStatic)
         {
             (bhv as Behaviors.IInternalBehavior).TransferFrom(original.Behaviors[i]);
         }
     }
 }
		public void Execute(params string[] args)
		{
			if (!(Program.ActiveInteraction is Interactions.SelectCards))
			{
				Console.WriteLine("ERROR: This command can only be invoked when a SelectCards message is requested.");
				Console.WriteLine("");
				return;
			}

			var selectCards = (Interactions.SelectCards)Program.ActiveInteraction;

			if (selectCards.Mode == Interactions.SelectCards.SelectMode.Single && args.Length > 1)
			{
				Console.WriteLine("ERROR: Only one card can be selected.");
				Console.WriteLine("");
				return;
			}

            int tmp;
            if (args.Any(i => !int.TryParse(i, out tmp)))
            {
                Console.WriteLine("Usage: Game.Select [{0}]", selectCards.Mode == Interactions.SelectCards.SelectMode.Single ? "card" : "card1 [card2...]");
                Console.WriteLine("  Select {0} as required by the game.", selectCards.Mode == Interactions.SelectCards.SelectMode.Single ? "card" : "cards");
                Console.WriteLine("  {0}:\tOrdinal number of all selectable cards.", selectCards.Mode == Interactions.SelectCards.SelectMode.Single ? "card" : "card1, card2...");
                Console.WriteLine("Type Game.SelectFrom to get the list of selectable cards.");
                Console.WriteLine("");
                return;
            }

            CardInstance[] cards = new CardInstance[args.Length];
            for (int i = 0; i < args.Length; ++i)
            {
                cards[i] = selectCards.Candidates[int.Parse(args[i]) - 1];
            }

            while (true)
            {
                Console.Write("?? Select {0} (Y/N) ? ",
                              cards.Length == 0 ? "nothing" : String.Join(" ", (from c in cards select c.Print()).ToArray()));
                string choice = Console.ReadLine().ToLower();
                if (choice == "y" || choice == "yes")
                {
                    selectCards.Respond(cards.ToIndexable());
                    Program.ActiveInteraction = null;
                    break;
                }
                else if (choice == "n" || choice == "no")
                {
                    break;
                }
            }
		}
        private string GetLocation(CardInstance card)
        {
            foreach (var player in Program.TouhouSpringGame.Players)
            {
                if (player.CardsOnHand.Contains(card))
                {
                    return player.Name + "'s hand";
                }
                else if (player.CardsOnBattlefield.Contains(card))
                {
                    return player.Name + "'s battlefield";
                }
            }

            return "#unknown location#";
        }
 internal bool IsCardRedeemable(CardInstance card)
 {
     return card.Zone == SystemZone.Sacrifice && IsCommandRunnable(new Commands.InitiativeMoveCard(card, SystemZone.Hand));
 }
 internal bool IsCardActivatable(CardInstance card)
 {
     return IsCommandRunnable(new Commands.ActivateAssist(card));
 }
 internal bool IsCardPlayable(CardInstance card)
 {
     return card.Zone == SystemZone.Hand && IsCommandRunnable(new Commands.PlayCard(card, SystemZone.Battlefield, card.Owner.Game));
 }
 internal void UnsubscribeCardFromCommands(CardInstance card)
 {
     m_globalTargetLists.Remove(card.Behaviors);
 }
 internal void SubscribeCardToCommands(CardInstance card)
 {
     m_globalTargetLists.Add(card.Behaviors);
 }