Beispiel #1
0
        private bool ProcessFarmType(IContentPack contentPack, out CustomFarm farm)
        {
            Dictionary <string, object> Extra;
            bool results;

            if (contentPack.Manifest.ExtraFields != null && contentPack.Manifest.ExtraFields.ContainsKey("ContentPackType"))
            {
                Extra = (Dictionary <string, object>)ObjectToDictionaryHelper.ToDictionary(contentPack.Manifest.ExtraFields["ContentPackType"]);
                if (Extra.ContainsKey("Farm") && bool.Parse(Extra["Farm"].ToString()))
                {
                    farm    = contentPack.ReadJsonFile <CustomFarm>("farmType.json");
                    results = true;
                }
                else
                {
                    farm    = null;
                    results = false;
                }
            }
            else
            {
                farm    = contentPack.ReadJsonFile <CustomFarm>("farmType.json");
                results = true;
            }
            return(results);
        }
Beispiel #2
0
        private bool ProcessGreenHouseType(IContentPack contentPack, out CustomGreenHouse greenHouse)
        {
            Dictionary <string, object> Extra;

            if (contentPack.Manifest.ExtraFields != null && contentPack.Manifest.ExtraFields.ContainsKey("ContentPackType"))
            {
                Extra = (Dictionary <string, object>)ObjectToDictionaryHelper.ToDictionary(contentPack.Manifest.ExtraFields["ContentPackType"]);
                if (Extra.ContainsKey("Greenhouse") && bool.Parse(Extra["Greenhouse"].ToString()))
                {
                    greenHouse = contentPack.ReadJsonFile <CustomGreenHouse>("greenHouseType.json");
                    return(true);
                }
            }
            greenHouse = null;
            return(false);
        }