private void LoadCategoryPageResponses() { Model model = GetDialogCustomData <Model>(); ClearPageResponses("BlueprintCategoryPage"); PCTerritoryFlag flag = _structure.GetPCTerritoryFlagByID(model.FlagID); TerritoryStructureCount counts = _structure.GetNumberOfStructuresInTerritory(model.FlagID); List <StructureCategory> categories = _structure.GetStructureCategoriesByType(GetPC().GlobalID, model.IsTerritoryFlag, false, false, false, false).ToList(); if (flag != null && counts.VanityCount < flag.StructureBlueprint.VanityCount) { categories.AddRange(_structure.GetStructureCategoriesByType(GetPC().GlobalID, model.IsTerritoryFlag, true, false, false, false)); } if (flag != null && counts.SpecialCount < flag.StructureBlueprint.SpecialCount) { categories.AddRange(_structure.GetStructureCategoriesByType(GetPC().GlobalID, model.IsTerritoryFlag, false, true, false, false)); } if (flag != null && counts.ResourceCount < flag.StructureBlueprint.ResourceCount) { categories.AddRange(_structure.GetStructureCategoriesByType(GetPC().GlobalID, model.IsTerritoryFlag, false, false, true, false)); } if (flag != null && counts.BuildingCount < flag.StructureBlueprint.BuildingCount) { categories.AddRange(_structure.GetStructureCategoriesByType(GetPC().GlobalID, model.IsTerritoryFlag, false, false, false, true)); } foreach (StructureCategory category in categories) { AddResponseToPage("BlueprintCategoryPage", category.Name, category.IsActive, new Tuple <string, dynamic>(string.Empty, category.StructureCategoryID)); } AddResponseToPage("BlueprintCategoryPage", "Back"); }
private void BuildMainPageHeader() { Model model = GetDialogCustomData <Model>(); int flagID = model.FlagID; PCTerritoryFlag flag = _structure.GetPCTerritoryFlagByID(flagID); TerritoryStructureCount counts = _structure.GetNumberOfStructuresInTerritory(flagID); var blueprint = flag.StructureBlueprint; string header = _color.Green("Territory Management Menu") + "\n\n" + _color.Green("Vanity Slots: ") + counts.VanityCount + " / " + blueprint.VanityCount + "\n" + _color.Green("Special Slots: ") + counts.SpecialCount + " / " + blueprint.SpecialCount + "\n" + _color.Green("Resource Slots: ") + counts.ResourceCount + " / " + blueprint.ResourceCount + "\n" + _color.Green("Building Slots: ") + counts.BuildingCount + " / " + blueprint.BuildingCount + "\n" + "Please select an option."; SetPageHeader("MainPage", header); }