Game.Economy.Resource
Assembly:
Assembly-CSharp.dll
Namespace:
Game.Economy
Type:
public enum
Base:
System.Enum (underlying type: System.UInt64 / ulong)
Summary:
Represents the different resource types used by the game's economy systems. Each named value is assigned a distinct ulong power-of-two value (bit mask), so values can be combined with bitwise operations to represent sets of resources. The enum includes common goods (Food, Wood, Metals, etc.), services (Lodging, Telecom), industrial inputs and outputs (Oil, Petrochemicals, Plastics), waste (Garbage), and special sentinel values such as NoResource, Last, and All.
Fields
-
NoResource = 0uL
Represents no resource (empty set). -
Money = 1uL
Currency resource. -
Grain = 2uL
Raw agricultural grain. -
ConvenienceFood = 4uL
Processed convenience food product. -
Food = 8uL
General food resource. -
Vegetables = 16uL
Vegetable produce. -
Meals = 32uL
Prepared meals (processed food). -
Wood = 64uL
Raw wood/logs. -
Timber = 128uL
Processed timber (sawn wood). -
Paper = 256uL
Paper products. -
Furniture = 512uL
Furniture goods. -
Vehicles = 1024uL
Passenger or commercial vehicles. -
Lodging = 2048uL
Service representing lodging capacity. -
UnsortedMail = 4096uL
Mail before sorting. -
LocalMail = 8192uL
Mail destined for local delivery. -
OutgoingMail = 16384uL
Mail leaving the city/region. -
Oil = 32768uL
Crude oil resource. -
Petrochemicals = 65536uL
Refined petrochemical products. -
Ore = 131072uL
Raw ore resource. -
Plastics = 262144uL
Plastic materials. -
Metals = 524288uL
General metals. -
Electronics = 1048576uL
Electronic goods. -
Software = 2097152uL
Software product/resource. -
Coal = 4194304uL
Coal resource. -
Stone = 8388608uL
Stone resource. -
Livestock = 16777216uL
Farm livestock. -
Cotton = 33554432uL
Cotton raw material. -
Steel = 67108864uL
Steel product. -
Minerals = 134217728uL
General mineral resources. -
Concrete = 268435456uL
Construction concrete. -
Machinery = 536870912uL
Machinery goods. -
Chemicals = 1073741824uL
Chemical products. -
Pharmaceuticals = 2147483648uL
Pharmaceutical products. -
Beverages = 4294967296uL
Drinkable beverage products. -
Textiles = 8589934592uL
Textile goods. -
Telecom = 17179869184uL
Telecommunication service/product. -
Financial = 34359738368uL
Financial services/products. -
Media = 68719476736uL
Media-related goods/services. -
Entertainment = 137438953472uL
Entertainment industry output. -
Recreation = 274877906944uL
Recreation-related services/goods. -
Garbage = 549755813888uL
Waste/trash resource. -
Fish = 1099511627776uL
Fish/seafaring food product. -
Last = 2199023255552uL
Sentinel value likely representing the highest explicitly defined resource bit; useful for iteration bounds or versioning checks. -
All = ulong.MaxValue
All bits set (all resources). Note: All sets every bit of the underlying ulong, which may include bits beyond the explicit resource values; treat with care.
Properties
- (none)
This enum defines no properties. It is intended for use as named constants/bit masks.
Constructors
- (none)
Enums have implicit constructors provided by the runtime; there are no custom constructors here.
Methods
- (none)
No enum-specific methods are declared. Typical operations are performed with built-in bitwise operators, Enum methods, and casts.
Usage Example
// Combine resources using bitwise OR
Game.Economy.Resource combo = Game.Economy.Resource.Wood | Game.Economy.Resource.Metal | Game.Economy.Resource.Food;
// Check if a specific resource is present (bitwise)
bool hasWood = (combo & Game.Economy.Resource.Wood) != 0;
// Or using Enum.HasFlag (works but is slower due to boxing on enums prior to .NET Core)
bool hasFood = combo.HasFlag(Game.Economy.Resource.Food);
// Add and remove flags
combo |= Game.Economy.Resource.Machinery; // add Machinery
combo &= ~Game.Economy.Resource.Metal; // remove Metals
// Iterate over defined resource flags (careful: Enum.GetValues will return all named values,
// including NoResource, Last and All)
foreach (Game.Economy.Resource r in Enum.GetValues(typeof(Game.Economy.Resource)))
{
if (r == Game.Economy.Resource.NoResource) continue;
if (r == Game.Economy.Resource.All) continue;
if (r == Game.Economy.Resource.Last) continue;
if ((combo & r) != 0)
{
Console.WriteLine($"Combo contains: {r}");
}
}
// Casting to ulong to inspect raw mask
ulong mask = (ulong)combo;
Console.WriteLine($"Raw mask: 0x{mask:X16}");
// Checking for any resource (non-empty)
bool any = combo != Game.Economy.Resource.NoResource;
Notes: - Although this enum is not annotated with [Flags] in the source snippet, the assigned values are powers of two and intended to be used as bit flags. Use bitwise operators to combine and test resources. - Use caution when using Resource.All, as it sets every bit of the ulong (including bits that are not currently assigned to a named resource).