Skip to content

Game.Prefabs.BuildingAccessType

Assembly: Assembly-CSharp
Namespace: Game.Prefabs

Type: enum

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

Summary:
Represents the allowed access directions (entrances/exits or service access) for a building prefab. Each enum value indicates which side(s) of a building are considered accessible for vehicle or pedestrian access, corner access, or combinations of sides. Use this when defining or querying how a building should be connected to roads, pedestrian paths, or service routing in mods that manipulate building prefabs or placement rules.


Fields

  • Front
    Represents access from the front side of the building (typically the main facade facing the road).

  • LeftCorner
    Access located at the left corner of the building footprint.

  • RightCorner
    Access located at the right corner of the building footprint.

  • LeftAndRightCorner
    Access available at both left and right corners of the building.

  • LeftAndBackCorner
    Access available at the left corner and the back corner of the building.

  • RightAndBackCorner
    Access available at the right corner and the back corner of the building.

  • FrontAndBack
    Access available on both the front and back sides of the building.

  • All
    Access available on all sides/corners of the building (full access around the footprint).

Properties

  • None. The enum has no properties.

Constructors

  • None (enum; implicit default value exists, underlying type is Int32).

Methods

  • None. Standard enum methods from System.Enum apply (ToString, Parse, HasFlag, etc.).

Usage Example

// Example: checking building access type when configuring placement rules
using Game.Prefabs;

public void ConfigureBuilding(GameObject buildingPrefab)
{
    // Suppose the prefab has a BuildingAccessType field/property; pseudo-code:
    var accessType = BuildingHelper.GetAccessType(buildingPrefab); // returns BuildingAccessType

    if (accessType == BuildingAccessType.Front || accessType == BuildingAccessType.FrontAndBack)
    {
        // Ensure front road connection is present
        RoadConnector.RequireFrontConnection(buildingPrefab);
    }

    if (accessType == BuildingAccessType.All)
    {
        // Allow placement regardless of orientation relative to roads
        PlacementHelper.AllowAllSides(buildingPrefab);
    }
}