示例#1
0
        public char LoadSaveGame(string saveGame)
        {
            var player = Constants.Black;
            var move   = new Pos();

            foreach (var character in saveGame)
            {
                if (char.IsLetter(character))
                {
                    move.X = Pos.ConvertLetter(character);
                }
                else if (char.IsDigit(character))
                {
                    move.Y = Pos.ConvertFromAsciiDigit(character);
                }
                else
                {
                    MakeMove(move, player);
                    PlacePiece(move, player);

                    player = GetOtherPlayer(player);
                }
            }

            return(player);
        }