Beispiel #1
0
 public void QueueHandCardMovement(HandCardMovementNotification notif)
 {
     lock (handCardMovements)
     {
         handCardMovements.Add(notif);
     }
 }
Beispiel #2
0
        private void HandleHandCardMovement(HandCardMovementNotification notif)
        {
            var player = notif.PlayerItem == null ? null : notif.PlayerItem.ToPlayer();

            if (player == null)
            {
                return;
            }
            var deck = Game.CurrentGame.Decks[player, DeckType.Hand];

            if (!(notif.To < 0 || notif.From < 0 || notif.From >= deck.Count || notif.To >= deck.Count))
            {
                var card1 = deck[notif.From];
                deck.Remove(card1);
                deck.Insert(notif.To, card1);
            }
        }