Exemplo n.º 1
0
 public static string Print(this GameTurn turn)
 {
     if (turn.Round < 0)
     {
         return($@"{turn.Stage}: {turn.Action}");
     }
     else
     {
         return(turn != null ? $@"{turn.Stage}: {turn.Player?.Name}, Round {turn.Round}, FC: {CardExtensions.FormatCard(turn.FaceCard)}, {turn.Action}, Hand: {CardExtensions.FormatHand(turn.Player?.Hand)}" : "");
     }
 }
Exemplo n.º 2
0
Arquivo: Game.cs Projeto: djericj/Uno
        private void Log(string stage, Player player, int round, string action)
        {
            var log = new GameTurn()
            {
                Stage          = stage,
                Player         = player,
                Round          = round,
                Action         = action,
                CardsRemaining = player.CardsRemaining,
                Hand           = player.Hand,
                HasUno         = player.Hand != null?player.Hand.Count() == 1 : false,
                FaceCard       = FaceCard
            };

            GameLog.Add(log);
            OnGameTurnCompleted <GameTurn>(log);
        }
Exemplo n.º 3
0
Arquivo: Game.cs Projeto: djericj/Uno
        private void Log(string stage, string action)
        {
            var log = new GameTurn()
            {
                Stage          = stage,
                Player         = null,
                Round          = -1,
                Action         = action,
                CardsRemaining = -1,
                Hand           = null,
                HasUno         = false,
                IsWinner       = false,
                FaceCard       = null
            };

            GameLog.Add(log);
            OnGameTurnCompleted <GameTurn>(log);
        }
Exemplo n.º 4
0
 private static void Game_GameTurnCompleted(GameTurn gameTurn)
 {
     Console.WriteLine(gameTurn.Print());
 }