Exemplo n.º 1
0
 protected void PlayActual(PlayCardArgs args, GameState gameState)
 {
     gameState.ActionQueue.EnqueueActions(
         Data.Actions.Zip(args.TargetInfos,
                          (actionData, targets) => actionData.CreateAction(Owner, targets, gameState))
         .SelectMany(a => a));
 }
Exemplo n.º 2
0
        public bool Play(PlayCardArgs args, GameState gameState)
        {
            if (!args.Valid)
            {
                return(false);
            }

            OnBeforePlay?.Invoke();

            PlayActual(args, gameState);

            OnAfterPlay?.Invoke();

            MoveTo(Owner.DiscardPile);

            return(true);
        }
Exemplo n.º 3
0
 public PlayCardAction(Unit player, Card cardToPlay, PlayCardArgs args)
 {
     _action = (gameState) => cardToPlay.Play(args, gameState);
     _player = player;
     _args   = args;
 }