Game.Prefabs.ObjectRequirementFlags
Assembly: Assembly-CSharp
Namespace: Game.Prefabs
Type: enum (flags)
Base: System.Enum (underlying type: System.UInt16)
Summary:
A bitmask enum used to represent various requirement or condition flags for in-game objects/prefabs (e.g., whether an object is for renters, children, affected by snow, etc.). Marked with [Flags], so values are intended to be combined with bitwise operations. The underlying storage is a 16-bit unsigned integer (ushort).
Fields
-
Renter = 1
Represents the "renter" requirement/flag (bit 0). -
Children = 2
Represents the "children" requirement/flag (bit 1). -
Snow = 4
Represents the "snow" requirement/flag (bit 2). Can indicate objects affected by or relevant during snowy conditions. -
Teens = 8
Represents the "teens" requirement/flag (bit 3). -
GoodWealth = 0x10
Represents the "good wealth" requirement/flag (bit 4). Stored as hexadecimal 0x10 (decimal 16). -
Dogs = 0x20
Represents the "dogs" requirement/flag (bit 5). Stored as hexadecimal 0x20 (decimal 32). -
Homeless = 0x40
Represents the "homeless" requirement/flag (bit 6). Stored as hexadecimal 0x40 (decimal 64).
Properties
- None specific to this enum type. Use standard enum/bitwise operations or Enum.HasFlag to query values.
- Example checks: (flags & ObjectRequirementFlags.Snow) == ObjectRequirementFlags.Snow or flags.HasFlag(ObjectRequirementFlags.Snow).
Constructors
- Enums do not define explicit constructors. Values are assigned from the underlying ushort when created/serialized. You can instantiate via casting from numeric values:
- (ObjectRequirementFlags)0x10
Methods
- None defined on the enum itself. Use System.Enum helpers (e.g., Enum.ToString, Enum.HasFlag) and bitwise operators.
Usage Example
// Combine flags
ObjectRequirementFlags flags = ObjectRequirementFlags.Renter | ObjectRequirementFlags.Children;
// Check using bitwise operator
bool needsChildren = (flags & ObjectRequirementFlags.Children) == ObjectRequirementFlags.Children;
// Check using HasFlag
bool isForRenters = flags.HasFlag(ObjectRequirementFlags.Renter);
// Add or remove flags
flags |= ObjectRequirementFlags.Dogs; // add Dogs
flags &= ~ObjectRequirementFlags.Renter; // remove Renter
// Cast from underlying ushort (e.g., when reading raw data)
ushort raw = 0x12; // GoodWealth (0x10) + Children (0x02)
ObjectRequirementFlags fromRaw = (ObjectRequirementFlags)raw;
Additional notes: - Because this enum is marked with [Flags], prefer combining flags with bitwise operators rather than creating large explicit enum values. - Keep in mind the underlying type is ushort; when serializing or interacting with native code, ensure you read/write 16-bit values.