예제 #1
0
        public static char LoadGameLog(char[] board, string gameLogLine)
        {
            var player = Constants.Black;
            var coord  = new Pos();

            foreach (var character in gameLogLine)
            {
                if (char.IsLetter(character))
                {
                    coord.X = Pos.ConvertLetter(character);
                }
                else if (char.IsDigit(character))
                {
                    coord.Y = Pos.ConvertDigit(character);
                }
                else
                {
                    InputHandler.MakeMove(board, coord, player);
                    InputHandler.PlacePiece(board, coord, player);

                    player = player == Constants.Black ? Constants.White : Constants.Black;
                }
            }

            return(player);
        }