Exemple #1
0
 public void Load()
 {
     //Load Level data here.
     _gameData.WriteToConsole(new[] { "Loading Level Data...\r" });
     _aiFactory = new AiFactory(_enemyShipParser, _gameData);
     _gameData.WriteToConsole(new[] { "Creating Level...\r" });
     CreateLevel();
 }
Exemple #2
0
        public void Load()
        {
            //Load Level data here.
            _gameData.WriteToConsole(new[] { "Loading Level Data...\r" });
            GameObjectLoader gol = new GameObjectLoader("Assets//Scripts//Gamedat.xml");

            _aiFactory = new AiFactory(gol.GetAiParser(), _gameData);
            CreateLevel();
        }
        public void Check(AiFactory factory)
        {
            var gamers = new List <IAi> {
                factory.Create(), factory.Create()
            };
            var gameSimulator = new GameSimulatorRunner(new SimpleScoreCalculator());

            var results = gameSimulator.SimulateGame(
                gamers, MapLoader.LoadMapByName(MapName).Map, new Settings());

            foreach (var gameSimulationResult in results)
            {
                Console.Out.WriteLine(
                    "gameSimulationResult = {0}:{1}", gameSimulationResult.Gamer.Name, gameSimulationResult.Score);
            }
        }
 public PlayerTournamentResult(AiFactory factory = null)
 {
     Factory = factory;
     Maps    = new HashSet <string>();
 }
Exemple #5
0
 public PlayerTournamentResult(AiFactory factory)
 {
     Factory = factory;
 }
Exemple #6
0
    void OnAiStrategyChanged(AiFactory.AiStrategyType _type)
    {
        if (mStrategy != null)
            mStrategy.OnLeave (ref mParam);

        mStrategy = AiFactory.GetAiStrategy (_type);

        if (mStrategy != null)
        {
            mStrategy.OnEnter (ref mParam);

            mCurStrategy = _type;
        }
    }