Octgn.Play.Card.MoveTo C# (CSharp) Method

MoveTo() public method

public MoveTo ( Group to, bool lFaceUp, bool isScriptMove ) : void
to Group
lFaceUp bool
isScriptMove bool
return void
        public void MoveTo(Group to, bool lFaceUp, bool isScriptMove)
        {
            // Default: move cards to the end of hand, top of table; but top of piles (which is index 0)
            int toIdx = to is Pile ? 0 : to.Cards.Count;
            MoveTo(to, lFaceUp, toIdx, isScriptMove);
        }

Same methods

Card::MoveTo ( Group to, bool lFaceUp, int idx, bool isScriptMove ) : void

Usage Example

Esempio n. 1
0
        public void CardMoveTo(int cardId, int groupId, int?position)
        {
            Card  card  = Card.Find(cardId);
            Group group = Group.Find(groupId);

            if (card.Controller != Player.LocalPlayer)
            {
                Program.GameMess.Warning(String.Format("{0} Can't move {1} to {2} because they don't control {1}.", Player.LocalPlayer.Name, card.Name, card.Name));
            }

            if (group.Controller != Player.LocalPlayer)
            {
                Program.GameMess.Warning(String.Format("{0} Can't move {1} to {2} because they don't control {1}.", Player.LocalPlayer.Name, card.Name, group.Name));
            }

            if (card.Group != Program.GameEngine.Table && card.Group.Controller != Player.LocalPlayer)
            {
                Program.GameMess.Warning(String.Format("{0} Can't move {1} from {2} because they don't control it.", Player.LocalPlayer.Name, card, card.Group));
            }

            QueueAction(() =>
            {
                //Program.GameEngine.EventProxy.MuteEvents = true;
                if (position == null)
                {
                    card.MoveTo(group, true, true);
                }
                else
                {
                    card.MoveTo(group, true, position.Value, true);
                }
                //Program.GameEngine.EventProxy.MuteEvents = false;
            });
        }