Exemple #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));
 }
Exemple #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);
        }
 public PlayCardAction(Unit player, Card cardToPlay, PlayCardArgs args)
 {
     _action = (gameState) => cardToPlay.Play(args, gameState);
     _player = player;
     _args   = args;
 }