コード例 #1
0
ファイル: Game.cs プロジェクト: Hacksie/Lachesis-Star
        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
ファイル: Game.cs プロジェクト: Hacksie/Lachesis-Star
        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
ファイル: Game.cs プロジェクト: Hacksie/Lachesis-Star
 public bool AddOre(PlanetItem item)
 {
     return(AddOre(item.name, item.qty));
 }