Esempio n. 1
0
    public Resources_Building(string id,
                              string name,
                              string image,
                              Enums.BuildingType type,
                              int money,
                              int income,
                              int expenses,
                              int rent,
                              int payment,
                              Enums.DayOfTheWeek day,
                              Resources_InventoryShop inventory)
        : base(id,
               name,
               image,
               money,
               income,
               expenses)
    {
        _type      = type;
        _payment   = payment;
        _day       = day;
        _type      = type;
        _inventory = inventory;

        Manager_Resources.NewBuilding(this);
    }
    public Resources_Building(string id,
	                            string name,
	                            string image,
	                            Enums.BuildingType type,
	                            int money,
	                            int income,
	                            int expenses,
	                            int rent,
	                            int payment,
	                            Enums.DayOfTheWeek day,
	                            Resources_InventoryShop inventory)
        : base(id,
		        name,
		        image,
		        money,
		        income,
		        expenses)
    {
        _type = type;
        _payment = payment;
        _day = day;
        _type = type;
        _inventory = inventory;

        Manager_Resources.NewBuilding(this);
    }
Esempio n. 3
0
    // 12 methods, 4 regions

    #region Generate Resources
    static protected List <string> GenerateBuildingResources(string scenarioID, JSONObject json)
    {
        List <string> existingBuildingResources = new List <string>();

        for (int i = 0; i < json.Count; i++)
        {
            JSONObject building = json[i];

            new Resources_Building(
                //id, name, image, type, money, income, expenses, rent, payment, day, inventory
                building.GetField("id").str,
                building.GetField("name").str,
                building.GetField("image").str,
                Enums.BuildingTypeFromStatic(building.GetField("type").str),
                Mathf.Clamp(int.Parse(building.GetField("money").str), moneyMin, moneyMax),
                Mathf.Clamp(int.Parse(building.GetField("income").str), moneyMin, moneyMax),
                Mathf.Clamp(int.Parse(building.GetField("expenses").str), moneyMin, moneyMax),
                Mathf.Clamp(int.Parse(building.GetField("rent").str), moneyMin, moneyMax),
                Mathf.Clamp(int.Parse(building.GetField("payment").str), moneyMin, moneyMax),
                Enums.DayOfTheWeekFromStatic(building.GetField("day").str),
                Resources_InventoryShop.GetShopInventoryByID(building.GetField("inventory").str)
                );
            existingBuildingResources.Add(building.GetField("id").str);
        }
        return(existingBuildingResources);
    }