Пример #1
0
        /// <summary>
        /// Creates a world.
        /// </summary>
        /// <param name="configuration">Contains the cometition/level name and the settings</param>
        /// <param name="controllerFactory">Is used to create controllers, i.e. entities that control the robots</param>
        /// <param name="state">The initial state of the world</param>
        /// <returns></returns>
        public IWorld CreateWorld(Infrastructure.GameSettings configuration, ControllerFactory controllerFactory, WorldState state)
        {
            var competitions = GetCompetitions(configuration.LoadingData);
            var world        = competitions.Logic.CreateWorld();

            world.Initialize(competitions, configuration, controllerFactory, state);
            world.Exit += () =>
                          controllerFactory.Exit();
            return(world);
        }
Пример #2
0
        public LogWriter(IWorld world, bool enableLog, string logFile, Infrastructure.GameSettings configuration, object worldState)
        {
            this.world         = world;
            this.enableLog     = enableLog;
            this.logFileName   = logFile;
            this.configuration = configuration;
            this.worldState    = worldState;

            world.Clocks.AddTrigger(new TimerTrigger(LogPositions, world.LoggingPositionTimeInterval));

            world.Scores.ScoresChanged += Scores_ScoresChanged;
            world.Exit += World_Exit;
        }