Game.Prefabs.AreasConfigurationData
Assembly: Assembly-CSharp (typical for Cities: Skylines mods)
Namespace: Game.Prefabs
Type: struct
Base: System.ValueType
Summary:
AreasConfigurationData is a lightweight ECS component (IComponentData) used to store configuration for an "area" or district prefab. It holds a reference to a default district prefab Entity and a slope bounds value (Bounds1) used to describe the maximum allowable slope for buildable land in that area. The struct also implements IQueryTypeParameter indicating it can be used as a query parameter type in the game's ECS-style queries.
Fields
-
public Entity m_DefaultDistrictPrefab
Holds an Entity reference to the default district prefab associated with this area configuration. This is typically an Entity that can be used to instantiate or identify the district type to apply for this area. -
public Bounds1 m_BuildableLandMaxSlope
Defines slope bounds for land considered buildable in this area. Bounds1 comes from Colossal.Mathematics and is used by the game to represent a 1-dimensional range (min/max) constraining allowable slopes for placement/building logic.
Properties
- This type defines no properties. It exposes two public fields only.
Constructors
public AreasConfigurationData()
As a struct, AreasConfigurationData has the default parameterless constructor which produces a zero-initialized instance (default Entity value and default Bounds1). You can initialize fields using object initializer syntax.
Methods
- This type defines no methods.
Usage Example
// Example: create and assign an AreasConfigurationData component to an entity
Entity defaultDistrictEntity = /* obtain or create the district prefab entity */;
Bounds1 slopeBounds = /* construct or obtain a Bounds1 describing allowed slope range */;
var config = new AreasConfigurationData
{
m_DefaultDistrictPrefab = defaultDistrictEntity,
m_BuildableLandMaxSlope = slopeBounds
};
entityManager.AddComponentData(areaEntity, config);
// or
entityManager.SetComponentData(areaEntity, config);
Additional notes: - This struct is intended to be a pure data container in the ECS world; systems should read its values to make placement/validation decisions or to spawn the configured district prefab. - Ensure Bounds1 is created with valid min/max values appropriate to the game's slope units to avoid unintended placement restrictions. - Because this is an IComponentData, consider whether it should live on a prefab entity or on runtime instances depending on how you intend to query and use it in systems.