Example #1
0
    void LoadMachinery()
    {
        if (machineryType == MachineType.END)
        {
            MachineData       = null;
            MachineryResource = ResourceType.END;
            Fuel             = ResourceType.END;
            BaseProductivity = 1;
        }
        else
        {
            MachineData = MachineDatabase.GetMachineData(machineryType);

            //CHANGE TO USE DEFINED HOURS CONTRIBUTED BY MACHINE
            if (MachineData == null)
            {
                Debug.LogError("Data does not exist for " + machineryType + " machinery");
            }


            MachineryResource = MachineData.material;
            Fuel = MachineData.fuel;
            //BaseProductivity = MachineData.improvement;
            int baseDays = ResourcesDatabase.GetBaseDays(product);
            //BaseProductivity = (float)(baseDays + MachineData.socialDays) / baseDays;
            BaseProductivity = (float)baseDays / MachineData.socialDays;
        }
    }
Example #2
0
    public override void Activate()
    {
        base.Activate();

        BaseDaysToGrow = ResourcesDatabase.GetBaseDays(cropType);

        JoinProductivityList(cropType);
    }
Example #3
0
    public override void Load(ObjSave o)
    {
        base.Load(o);

        BaseDaysToGrow = ResourcesDatabase.GetBaseDays(cropType);

        CropSave c = (CropSave)o;

        GrowTimer = c.GrowTimer;
        JoinProductivityList(cropType);
    }
Example #4
0
    private void Update()
    {
        float baseDays           = ResourcesDatabase.GetBaseDays(ItemName);
        float localProductivity  = ProductivityController.GetAverageProductivityHere(ItemName);
        float globalProductivity = ProductivityController.GetAverageProductivityEverywhere(ItemName);

        daysWorldWide.text = Mathf.RoundToInt(baseDays / globalProductivity) + " days";
        daysLocal.text     = localProductivity > 0 ? "(" + Mathf.RoundToInt(baseDays / localProductivity) + " days here)" : "(??? days here)";

        ItemOrder io = new ItemOrder(100, ItemName);

        valueLabel.text = MoneyController.symbol + io.ExchangeValue().ToString("n2");
    }