Exemplo n.º 1
0
        public LevelController(IConfig config, MapSerializationModel mapSerializationModel)
        {
            /*
             * Bootstrap simulation
             */
            var levelContainer = LevelBootstrapper.CreateContainer(config);

            _graphicsResourceManager = levelContainer.Resolve <GraphicsResourceManager>();

            _uiState = levelContainer.Resolve <UiStateModel>();

            _updateController  = levelContainer.Resolve <UpdateController>();
            _overlayController = levelContainer.Resolve <OverlayController>();
            _fieldController   = levelContainer.Resolve <FieldController>();

            var map       = levelContainer.Resolve <MapModel>();
            var mapLoader = levelContainer.Resolve <MapLoader>();

            mapLoader.InitializeMap(map, mapSerializationModel);

            /*
             * Other initialization
             */

            var simulationManager    = levelContainer.Resolve <ISimulationManager>();
            var simulationStateModel = levelContainer.Resolve <SimulationStateModel>();

            _updateEventArgs = new UpdateEventArgs(simulationManager, simulationStateModel);
        }
Exemplo n.º 2
0
 public SimulationManager(UpdateController updateController, MapModel map, IAgentProvider agentProvider, IIndicatorRegistry indicatorRegistry)
 {
     _map = map ?? throw new ArgumentNullException(nameof(map));
     _updateController  = updateController ?? throw new ArgumentNullException(nameof(updateController));
     _agentProvider     = agentProvider ?? throw new ArgumentNullException(nameof(agentProvider));
     _indicatorRegistry = indicatorRegistry ?? throw new ArgumentNullException(nameof(indicatorRegistry));
 }