Skip to content

Game.Economy.ResourceInEditor

Assembly:
Assembly-CSharp (game assemblies may vary; this enum is defined in the game's managed assembly)

Namespace: Game.Economy

Type: enum

Base: System.Enum (underlying type: System.Int32)

Summary: ResourceInEditor is a serializable enumeration used by the game/editor to represent the different resource types that can be selected, displayed or referenced inside the in-game editor tooling (e.g., placement/inspection UIs, dropdowns, save data referencing resource types). It enumerates raw materials, processed goods, services and special tokens (like Money and Count). The enum is marked [Serializable] so its values can be stored in serialized data structures.


Fields

  • NoResource
    Represents absence of any resource / default empty selection.

  • Money
    Currency/money resource (used for finance-related editor options or economy testing).

  • Grain
    Raw agricultural crop (grain).

  • ConvenienceFood
    Processed convenience food product.

  • Food
    General food resource (generic food item/category).

  • Vegetables
    Raw vegetable agricultural resource.

  • Meals
    Prepared meals / catering product.

  • Wood
    Raw wood resource (unprocessed).

  • Timber
    Processed wood, typically lumber/timber.

  • Paper
    Paper product (from wood/timber processing).

  • Furniture
    Manufactured furniture items.

  • Vehicles
    Vehicles / automobiles resource type.

  • Lodging
    Service-based resource representing lodging/hotel capacity.

  • UnsortedMail
    Postal resource: unsorted mail.

  • LocalMail
    Postal resource: local mail.

  • OutgoingMail
    Postal resource: mail being sent out.

  • Oil
    Crude oil resource.

  • Petrochemicals
    Petrochemical products derived from oil.

  • Ore
    Raw ore/mineral resource.

  • Plastics
    Plastics / polymer products.

  • Metals
    Generic metal resource (unspecified metal goods).

  • Electronics
    Electronic components/products.

  • Software
    Software/digital goods resource.

  • Coal
    Coal resource.

  • Stone
    Stone/quarry resource.

  • Livestock
    Animal agricultural resource / livestock.

  • Cotton
    Raw cotton fiber resource.

  • Steel
    Steel product (processed metal).

  • Minerals
    Various mined minerals (distinct from ore/stone).

  • Concrete
    Concrete building material.

  • Machinery
    Industrial machinery / heavy equipment.

  • Chemicals
    Chemical products (industrial chemicals).

  • Pharmaceuticals
    Medical / pharmaceutical products.

  • Beverages
    Drinks / beverage products.

  • Textiles
    Textile products (from cotton/others).

  • Telecom
    Telecommunications service/resource.

  • Financial
    Financial services resource.

  • Media
    Media industry resource (publishing/broadcasting).

  • Entertainment
    Entertainment industry resource (leisure products/services).

  • Recreation
    Recreation/leisure services resource.

  • Garbage
    Waste/garbage resource (collection/processing).

  • Fish
    Fishery / seafood resource.

  • Count
    Sentinel value representing the number of declared resource entries. Use to bound loops or arrays; not itself a selectable in-game resource.

Properties

  • (None)
    This enum type does not declare instance properties. Use standard System.Enum methods (Enum.GetValues, Enum.Parse, etc.) to work with values.

Constructors

  • (None)
    Enums do not expose constructors in user code. Each member corresponds to an integral constant.

Methods

  • (None declared)
    No methods are declared on the enum. Use framework-provided utilities:
  • Enum.GetValues(typeof(ResourceInEditor))
  • Enum.IsDefined(typeof(ResourceInEditor), value)
  • (cast to/from int) to store/compare numeric values

Usage Example

// Populate an editor dropdown with all resources except the Count sentinel:
foreach (ResourceInEditor resource in Enum.GetValues(typeof(ResourceInEditor)))
{
    if (resource == ResourceInEditor.Count || resource == ResourceInEditor.NoResource)
        continue;

    dropdown.AddOption(resource.ToString());
}

// Example utility: check whether a resource is a raw material (illustrative)
bool IsRawMaterial(ResourceInEditor r)
{
    switch (r)
    {
        case ResourceInEditor.Grain:
        case ResourceInEditor.Wood:
        case ResourceInEditor.Ore:
        case ResourceInEditor.Coal:
        case ResourceInEditor.Stone:
        case ResourceInEditor.Cotton:
        case ResourceInEditor.Fish:
            return true;
        default:
            return false;
    }
}

// Example: safely iterate using Count sentinel
for (int i = 0; i < (int)ResourceInEditor.Count; i++)
{
    ResourceInEditor r = (ResourceInEditor)i;
    // process r
}

Notes and tips: - Do not change the numeric ordering/values of existing enum members in released mods or save-related code — altering values breaks persisted references and compatibility. - Use ResourceInEditor.Count as a stable way to size arrays or iterate valid values. - The enum is marked [Serializable], so it can be stored in Unity serialized objects or custom save data.