Esempio 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)}" : "");
     }
 }
Esempio n. 2
0
File: Game.cs Progetto: 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);
        }
Esempio n. 3
0
File: Game.cs Progetto: 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);
        }
Esempio n. 4
0
 private static void Game_GameTurnCompleted(GameTurn gameTurn)
 {
     Console.WriteLine(gameTurn.Print());
 }