Example #1
0
        public GameStage(
            Rules rules,
            PlayerGroupInfo playerGroupInfo,
            Action confirmAction)
        {
            Rules           = rules;
            PlayerGroupInfo = playerGroupInfo;
            ConfirmAction   = confirmAction;
            CurrentPlayer   = GetRandomPlayer();
            var deck      = CardPile.CreateDeckPile();
            var gameRound = new GameRound(Rules, PlayerGroupInfo, ConfirmAction, CurrentPlayer, deck);

            GameRoundList.Add(gameRound);
        }
Example #2
0
 public void ProcessAction(ActionBase action)
 {
     Log.Information(action.ToString());
     CurrentGameRound.ProcessAction(action);
     if (CurrentGameRound.RoundResult != null)
     {
         Log.Information(CurrentGameRound.RoundResult.ToString());
         ConfirmAction?.Invoke();
         GameResult = GetGameResult();
         if (GameResult == null)
         {
             CurrentPlayer = PlayerGroupInfo.GetNextPlayer(CurrentPlayer.PlayerId);
             var deck      = CardPile.CreateDeckPile();
             var gameRound = new GameRound(Rules, PlayerGroupInfo, ConfirmAction, CurrentPlayer, deck);
             GameRoundList.Add(gameRound);
         }
         else
         {
             Log.Information(GameResult.ToString());
         }
     }
 }