Пример #1
0
        public bool AddUpgradeEngine(PlanetItem item)
        {
            EngineData engine = upgradeManager.upgradesEngines.First(e => e.name == item.name);

            Logger.Log(name, engine.name, engine.thrustRate.ToString(), " to upgrade");


            var engineToUpgrade = state.shipState.engines[0].thrustRate < state.shipState.engines[1].thrustRate ? state.shipState.engines[0] : state.shipState.engines[1];

            if (engineToUpgrade.thrustRate < engine.thrustRate)
            {
                Logger.Log(name, engineToUpgrade.name, "upgrade engine");
                engineToUpgrade = new Engine()
                {
                    name        = engine.name,
                    description = engine.description,
                    thrustRate  = engine.thrustRate,
                    engine      = engineToUpgrade.engine
                };

                return(true);
            }

            return(false);
        }
Пример #2
0
        public bool AddUpgradeCargo(PlanetItem item)
        {
            CargoUpgradeData cargoUpgradeData = upgradeManager.upgradesCargo.First(e => e.name == item.name);

            if (state.shipState.cargoUpgrades < cargoUpgradeData.level)
            {
                state.shipState.cargoUpgrades = cargoUpgradeData.level;
                return(true);
            }
            return(false);
        }
Пример #3
0
        public void UpdatePanel(PlanetItem planetItem)
        {
            if (planetItem.qty == 0)
            {
                button.interactable = false;
            }
            else
            {
                button.interactable = true;
            }

            this.planetItem = planetItem;
            nameText.text   = planetItem.name + " " + planetItem.description;
            qtyText.text    = planetItem.qty.ToString();
            priceText.text  = "$" + planetItem.price;
        }
Пример #4
0
 public bool AddOre(PlanetItem item)
 {
     return(AddOre(item.name, item.qty));
 }