Example #1
0
    //create lists of structures which contribute to an item's productivity
    //  this should be done whenever the world loads; structures are added to the list upon creation and save-loading
    //  this isn't saved between games because (1) structures cannot be serialized and (2) we don't need to know this all of the time, only at the start of each quarter
    public static void LoadProductivityLists()
    {
        generators = new Dictionary <string, List <Structure> >();
        List <string> items = Enums.GetAllItems();

        foreach (string item in items)
        {
            generators[item] = new List <Structure>();
        }
    }
Example #2
0
    public static void UpdateProductivities()
    {
        List <string> items = Enums.GetAllItems();

        foreach (string item in items)
        {
            productivities[item]  = UpdateProductivity(item);
            automationValue[item] = UpdateAutomation(item);
            //Debug.Log(automationValue[item]);
        }
    }
Example #3
0
    // Use this for initialization
    void Start()
    {
        List <string> items = Enums.GetAllItems();

        foreach (string item in items)
        {
            if (!ResourcesDatabase.ItemAllowed(item))
            {
                continue;
            }

            GameObject go = Instantiate(UIObjectDatabase.GetUIElement("ItemValueUI"));
            go.transform.SetParent(grid.transform);

            ItemValueUI iv = go.GetComponent <ItemValueUI>();
            iv.ItemName = item;
            iv.Tooltip  = tooltip;
        }
    }