Game.Net.AvailableResource
Assembly:
Namespace: Game.Net
Type: enum
Base: System.Enum
Summary:
Represents the different kinds of resources, services and transport options the game's networking/availability systems track for a city. This enum is commonly used as an index/identifier when counting or reporting availability (e.g., supply chains, workplace availability, public transport presence). The last member, Count, is a sentinel value representing the total number of entries and is frequently used to size arrays or loops.
Fields
-
Workplaces
Represents workplace availability (jobs). -
Services
General service availability (e.g., police, health, fire coverage). -
UneducatedCitizens
Availability or count of uneducated citizens (workers without education). -
EducatedCitizens
Availability or count of educated citizens (skilled/educated workforce). -
OutsideConnection
Represents availability related to outside connections (imports/exports, external traffic). -
ConvenienceFoodStore
Availability of convenience food stores (retail outlets for quick food). -
GrainSupply
Supply level for grain resources. -
VegetableSupply
Supply level for vegetable resources. -
WoodSupply
Supply level for raw wood. -
TextilesSupply
Supply level for textiles. -
ConvenienceFoodSupply
Supply of convenience food items. -
PaperSupply
Supply of paper materials. -
VehiclesSupply
Supply of vehicles (for industry or transport). -
OilSupply
Supply level for oil. -
PetrochemicalsSupply
Supply of petrochemical products. -
OreSupply
Supply level for ore. -
MetalsSupply
Supply level for processed metals. -
ElectronicsSupply
Supply level for electronic components. -
Attractiveness
Represents city attractiveness (tourism/land value metric). -
PlasticsSupply
Supply level for plastics. -
CoalSupply
Supply level for coal. -
StoneSupply
Supply level for stone materials. -
LivestockSupply
Supply for livestock-related goods. -
CottonSupply
Supply of cotton. -
SteelSupply
Supply of steel products. -
MineralSupply
Supply of various minerals. -
ChemicalSupply
Supply level for chemicals. -
MachinerySupply
Supply level for machinery components. -
BeveragesSupply
Supply level for beverages. -
TimberSupply
Supply level for processed timber. -
Taxi
Availability/coverage of taxi transport. -
Bus
Availability/coverage of bus transport. -
TramSubway
Availability/coverage of tram and subway transport. -
FishSupply
Supply level for fish/seafood. -
Count
Sentinel value representing the total number of enum entries. Useful for sizing arrays or iterating over all resource types.
Properties
- This enum has no properties.
Enums are value types; each member has an underlying integer value (default: int starting at 0).
Constructors
- Enums do not define constructors in user code. Instances are created by assigning one of the enum members.
Methods
- Enums provide standard System.Enum methods (ToString, Parse, GetValues, etc.) via the base type. No custom methods are declared here.
Usage Example
// Example: create an array sized by the enum Count to hold numeric availability values.
int[] availability = new int[(int)Game.Net.AvailableResource.Count];
// Set some values
availability[(int)Game.Net.AvailableResource.Workplaces] = 12345;
availability[(int)Game.Net.AvailableResource.Bus] = 1;
// Iterate and handle each resource type
for (int i = 0; i < (int)Game.Net.AvailableResource.Count; i++)
{
var resource = (Game.Net.AvailableResource)i;
Console.WriteLine($"{resource}: {availability[i]}");
}
// Switch example for handling specific resources
Game.Net.AvailableResource r = Game.Net.AvailableResource.EducatedCitizens;
switch (r)
{
case Game.Net.AvailableResource.EducatedCitizens:
// handle educated workforce logic
break;
case Game.Net.AvailableResource.UneducatedCitizens:
// handle uneducated workforce logic
break;
// other cases...
}
Additional notes for modders: - The numeric ordering of enum members is important if the enum is used for serialization, networking, or as array indices. Avoid changing or reordering members in mods that interact with game save/network data. - Use the Count member when allocating arrays or iterating to remain compatible with the full set of resource types.