public PlayerUnitsMapEditorTool([Inject(Id = MapEditorInstaller.PLAYER_UNITS_TILES_CURSOR)]
                                 Texture2D cursorTexture,
                                 IMutableMapSectionData mapSectionData)
 {
     _cursorTexture  = cursorTexture;
     _mapSectionData = mapSectionData;
 }
 public void Construct(IMapData mapData,
                       IMutableMapSectionData mutableMapSectionData,
                       ILogger logger)
 {
     _mapData        = mapData;
     _mapSectionData = mutableMapSectionData;
     _logger         = logger;
 }
Пример #3
0
 public SectionTileMapEditorTool([Inject(Id = MapEditorInstaller.SECTION_TILES_CURSOR)]
                                 Texture2D cursorTexture,
                                 EditSectionTileViewController editSectionTileViewController,
                                 IMutableMapSectionData mapSectionData)
 {
     _cursorTexture = cursorTexture;
     _editSectionTileViewController = editSectionTileViewController;
     _mapSectionData = mapSectionData;
 }
 public UnitMapElement(ICommandQueue commandQueue,
                       IUnit unit,
                       IntVector2 tileCoords,
                       ILogger logger,
                       IMutableMapSectionData mapSectionData,
                       IUnitDataIndexResolver unitDataIndexResolver)
 {
     _unit                  = unit;
     _tileCoords            = tileCoords;
     _logger                = logger;
     _mapSectionData        = mapSectionData;
     _unitDataIndexResolver = unitDataIndexResolver;
     _commandQueue          = commandQueue;
 }
 public UnitMapEditorTool([Inject(Id = MapEditorInstaller.UNIT_TILES_CURSOR)]
                          Texture2D cursorTexture,
                          IGridUnitManager gridUnitManager,
                          ICommandQueue commandQueue,
                          IUnitSpawnViewController unitSpawnViewController,
                          ILogger logger,
                          IUnitDataIndexResolver unitDataIndexResolver,
                          IMutableMapSectionData mapSectionData)
 {
     _cursorTexture           = cursorTexture;
     _gridUnitManager         = gridUnitManager;
     _commandQueue            = commandQueue;
     _unitSpawnViewController = unitSpawnViewController;
     _logger = logger;
     _unitDataIndexResolver = unitDataIndexResolver;
     _mapSectionData        = mapSectionData;
 }
Пример #6
0
        private IObservable <Unit> LoadMapSection(uint nextSection)
        {
            MapSectionWillLoad?.Invoke();

            // While we change scenes, pause any commands from being processed.
            // This avoids race conditions with commands being instantiated in the wrong context.
            _pausableCommandQueue.Pause();

            _previousSection = _mapSectionContext.CurrentSectionIndex;
            _mapSectionContext.CurrentSectionIndex = nextSection;

            if (_loadedScenes.ContainsKey(_previousSection))
            {
                _loadedScenes[_previousSection].Deactivate();
            }

            if (_loadedScenes.ContainsKey(nextSection))
            {
                _pausableCommandQueue.Resume();
                _loadedScenes[nextSection].Reactivate();
                return(Observable.ReturnUnit());
            }

            IMutableMapSectionData mapSectionData = _mapData.Sections[nextSection];

            return(_sceneLoader.LoadSceneAsync(_data.mapCommandData.SectionSceneName,
                                               LoadSceneMode.Additive,
                                               container => {
                _loadedScenes[nextSection] =
                    new SceneState(SceneManager.GetSceneAt(SceneManager.sceneCount - 1));

                container.Bind <IGridData>().FromInstance(mapSectionData.GridData);
                container.Bind <IMapSectionData>().FromInstance(mapSectionData);
                if (_data.mapCommandData.isMapEditor)
                {
                    container.Bind <IMutableMapSectionData>().FromInstance(mapSectionData);
                }
                _pausableCommandQueue.Resume();
            }).ToUniTask().ToObservable());
        }
 public SectionTileMapElement(IMutableMapSectionData mutableMapSectionData, IntVector2 tileCoords)
 {
     _mutableMapSectionData = mutableMapSectionData;
     _tileCoords            = tileCoords;
 }
 public PlayerUnitsMapElement(IMutableMapSectionData mapSectionData)
 {
     _mapSectionData = mapSectionData;
 }