Game.Objects.RotationSymmetry
Assembly: Assembly-CSharp
Namespace: Game.Objects
Type: enum
Base: System.Byte
Summary:
An enum describing which rotational symmetries an in-game object supports for placement/rotation. Values encode common rotation step options (none, 180°, 90°, 45°) and a catch‑all "Any" value. The enum uses a byte as the underlying type and is declared public in the Game.Objects namespace.
{{ This enum is typically used by placement, snapping or symmetry systems in Cities: Skylines 2 mods to determine allowed rotations for objects (e.g., whether an object can be rotated in 90° steps, 45° steps, etc.). Note that the enum values are defined such that they can be used in bitwise checks even though the type is not annotated with [Flags]. }}
Fields
-
public RotationSymmetry None = 0
{{ Represents no rotational symmetry/rotation support. Use when an object should not be rotated automatically or does not support symmetric rotations. }} -
public RotationSymmetry _180 = 2
{{ Indicates support for 180° symmetry (two orientations). The name begins with an underscore because identifiers cannot start with a digit. Use to allow flipping/orienting objects only at 0° and 180°. }} -
public RotationSymmetry _90 = 4
{{ Indicates support for 90° symmetry (four orientations: 0°, 90°, 180°, 270°). Common for square/tile-aligned objects. }} -
public RotationSymmetry _45 = 8
{{ Indicates support for 45° symmetry (eight orientations at 45° increments). Useful for objects that can be rotated in finer steps. }} -
public RotationSymmetry Any = 127
{{ A catch‑all value representing "any" rotation/symmetry. The numeric value 127 (0x7F) sets multiple bits and can be treated as "allow all rotations" in checks. Note that 127 is larger than the explicit power-of-two members above, so it may include additional internal bits—treat it as a wildcard rather than a strict bitwise union of the defined members. }}
Properties
- (none)
{{ This enum defines no properties. Use direct enum values or bitwise operations in code. }}
Constructors
- (none)
{{ Enums do not have explicit constructors. They can be cast from/to the underlying byte as needed. Example: byte raw = (byte)rotationSymmetry; }}
Methods
- (none)
{{ There are no methods defined on the enum. Use standard enum operations (comparison, casting, bitwise operations). }}
Usage Example
// Example checks and usage patterns:
RotationSymmetry sym = RotationSymmetry._90;
// equality check
if (sym == RotationSymmetry.None) {
// no rotation allowed
}
// bitwise check (works even without [Flags])
// check if 90-degree steps are allowed
if ((sym & RotationSymmetry._90) != 0) {
// allow 90-degree rotation increments
}
// allow combining values (if you construct combined rules)
RotationSymmetry combined = (RotationSymmetry)((byte)RotationSymmetry._90 | (byte)RotationSymmetry._45);
// treat Any as a wildcard
if (sym == RotationSymmetry.Any) {
// object supports any rotation
}
// casting to underlying byte
byte raw = (byte)sym;
{{ Tips for modders: - Even though the enum is not marked [Flags], you can use bitwise operations to test support for a specific symmetry. Just be careful when interpreting RotationSymmetry.Any (127) — treat it as "all/any" rather than assuming it equals a simple OR of the named members. - Use the underscore-prefixed names (_180, _90, _45) when referring to the corresponding angles. - This enum is commonly consulted by placement tools, snapping logic, and symmetry-based copy/placement features. }}