Sanguosha.Core.Games.Game.PlayerAcquiredCard C# (CSharp) Méthode

PlayerAcquiredCard() public méthode

public PlayerAcquiredCard ( Player p, List cards ) : void
p Player
cards List
Résultat void
        public void PlayerAcquiredCard(Player p, List<Card> cards)
        {
            try
            {
                GameEventArgs arg = new GameEventArgs();
                arg.Source = p;
                arg.Targets = null;
                arg.Cards = cards;
                Emit(GameEvent.CardsAcquired, arg);
            }
            catch (TriggerResultException)
            {
                throw new NotImplementedException();
            }
        }

Usage Example

Exemple #1
0
 private static void StartGameDeal(Game game)
 {
     List<CardsMovement> moves = new List<CardsMovement>();
     // Deal everyone 4 cards
     foreach (Player player in game.Players)
     {
         CardsMovement move = new CardsMovement();
         move.Cards = new List<Card>();
         move.To = new DeckPlace(player, DeckType.Hand);
         for (int i = 0; i < 4; i++)
         {
             game.SyncImmutableCard(player, game.PeekCard(0));
             Card c = game.DrawCard();
             move.Cards.Add(c);
         }
         moves.Add(move);
     }
     game.MoveCards(moves, null);
     int p = 0;
     foreach (Player player in game.Players)
     {
         game.PlayerAcquiredCard(player, moves[p].Cards);
         p++;
     }
 }