Esempio n. 1
0
        private void PopulateConstructionContent()
        {
            var lyrans = _mapData.GetFaction(Factions.Lyran);
            var plan   = lyrans.Shipyard.ConstructionPlan.GetBasePlanForTurn(136);
            List <List <ShipClass> > planSubstitutions = new List <List <ShipClass> >(plan.Count);

            for (int i = 0; i < plan.Count; i++)
            {
                ShipClass shipClass     = plan[i];
                var       substitutions = lyrans.Shipyard.GetPossibleSubstitutions(shipClass)
                                          .Where(s => s.NewClass.DateAvailable <= CurrentTurn)
                                          .Select(s => s.NewClass)
                                          .ToList();
                substitutions.Insert(0, shipClass);
                planSubstitutions.Add(substitutions);
            }

            ConstructionDialog.PopulateDropdowns(planSubstitutions);
        }
Esempio n. 2
0
        private void Awake()
        {
            if (instance == null)
            {
                instance = this;
            }
            else if (instance != this)
            {
                Destroy(gameObject);
            }
            DontDestroyOnLoad(gameObject);

            _states    = new IState[2];
            _states[0] = new Deploy();
            _states[1] = new Economics();

            FleetDisplayArea.OnShipInfoDragged   += ShipInfo_Dragged;
            FleetDisplayArea.OnShipInfoDragEnd   += ShipInfo_DragEnd;
            FleetDisplayArea.OnFleetDisplayEmpty += FleetDisplayArea_Empty;
            FleetDisplayArea.OnFleetSelected     += FleetDisplayArea_FleetSelected;

            HexGrid.OnHexEntered += HexGrid_HexEntered;
            HexGrid.OnHexExited  += HexGrid_HexExited;
            HexGrid.OnHexSelect  += PopulateHexContents;

            DataStore.DataStore store = new DataStore.DataStore();
            _mapData = store.GetMapData();
            //_shipClasses = store.GetShipClasses();
            CurrentTurn    = 136;
            _activeFaction = _mapData.GetFaction(Factions.Lyran);
            PopulateProvinceNodes();
            PopulateVisualNodes();
            HexGrid.PopulateVisualData(_visualNodes, _provinceList);

            _currentState       = _states[0];
            PhaseButton.enabled = false;

            /*_disabledCursorTexture = new Texture2D((int)DisabledCursorSprite.textureRect.width, (int)DisabledCursorSprite.textureRect.height);
             * var pixels = DisabledCursorSprite.texture.GetPixels((int)DisabledCursorSprite.textureRect.x,
             *                                      (int)DisabledCursorSprite.textureRect.y,
             *                                      (int)DisabledCursorSprite.textureRect.width,
             *                                      (int)DisabledCursorSprite.textureRect.height);
             * _disabledCursorTexture.SetPixels(pixels);
             * _disabledCursorTexture.Resize(32, 32);
             * _disabledCursorTexture.Apply();*/
        }