コード例 #1
0
ファイル: MatchRunner.cs プロジェクト: rm2k/space-invaders
        private static void UndoBotMove(Match game, PlayerType playerType, int playerNumber, BotMove move)
        {
            var command = move.Command.ToString();

            if (move.Command == ShipCommand.BuildShield)
            {
                var botShip = game.GetPlayer(playerNumber);
                if (botShip.Ship == null)
                {
                    botShip.Lives += Settings.Default.ShieldCost;
                    game.Undo(playerType);
                    game.Depth--;
                    return;
                }
            }

            game.SetPlayerMove(playerNumber, command);

            game.Undo(playerType); //should use LastCommand or else restore command before

            game.Depth--;
        }
コード例 #2
0
ファイル: MatchRunner.cs プロジェクト: rm2k/space-invaders
        private static void DoBotMove(Match game, PlayerType playerType, int playerNumber, int depth, BotMove move)
        {
            //TODO: BotMove
            game.Depth++;

            var command = move.Command.ToString();

            game.SetPlayerMove(playerNumber, command);

            game.Update(playerType);//set Command = Nothing after update
        }