Exemplo n.º 1
0
        private void MakeFactionCores(IMapManager mapManager, IFactionManager factionManager)
        {
            var faction = factionManager.GetPlayerFaction();

            faction.ModifyResource(new Dictionary <ResourceType, int>()
            {
                { ResourceType.Gold, 10 },
                { ResourceType.Food, 10 },
                { ResourceType.Stone, 10 },
                { ResourceType.Wood, 10 },
            });

            var coreCell = mapManager.GetRandomCell((cell) => cell.Terrain.Type == TerrainType.Grass);

            faction.StructureManager.AddStructure(StructureDefinition.StructureType.Core, coreCell.Coord);

            var roadRect = coreCell.NonNullNeighbors;

            foreach (var cell in roadRect)
            {
                faction.StructureManager.AddStructure(StructureDefinition.StructureType.Road, cell.Coord);
            }

            foreach (var roadStub in CellExtensions.GetCardinalsOutsideRectangle(roadRect))
            {
                faction.StructureManager.AddStructure(StructureDefinition.StructureType.Road, roadStub.Coord);
            }

            factionManager.MoveToNextTurn();
        }
Exemplo n.º 2
0
        public override void Initialize()
        {
            _factionManager = Locate <IFactionManager>();
            _playerFaction  = _factionManager.GetPlayerFaction();
            _factionManager.OnTurnStarted += FactionManager_OnTurnStarted;
            _spawnManager = Locate <ISpawnManager>();

            _currentPlayerLabel = GetComponentInChildren <CurrentPlayerLabel>();
            _currentPlayerLabel.Hide();

            _drawView = GetComponentInChildren <DrawView>();
            HideDrawView();
            _endTurnButton = GetComponentInChildren <EndTurnButton>();

            RadialMenuManager = new RadialMenuManager(_spawnManager, transform);
            MessageManager    = new MessageManager(_spawnManager, transform);
        }