Game.Prefabs.InfoviewCoverageData
Assembly:
Namespace: Game.Prefabs
Type: struct
Base: IComponentData, IQueryTypeParameter
Summary:
InfoviewCoverageData is a small ECS component used by the infoview/coverage systems in Cities: Skylines 2. It pairs a CoverageService reference with a Bounds1 describing the spatial range the coverage data applies to. As an IComponentData it can be added to entities; implementing IQueryTypeParameter indicates it is intended to be used as a type parameter in queries or systems that operate on coverage infoview data.
Fields
-
public CoverageService m_Service
Holds a reference to the CoverageService instance that provides or manages coverage information for the infoview. CoverageService is a game-specific service type (not a Unity or DOTS type) responsible for coverage calculations and lookups. -
public Bounds1 m_Range
Defines the spatial range (bounds) the coverage information applies to. Bounds1 comes from Colossal.Mathematics and represents an axis-aligned 2D/3D range used by the game's math utilities. Use this to restrict or query coverage only within a specified region.
Properties
- (none)
Constructors
public InfoviewCoverageData()
Structs have a default parameterless constructor that initializes fields to their default values (m_Service = null, m_Range = default).
Methods
- (none)
Usage Example
// Example: add InfoviewCoverageData to an entity in a DOTS system
// assumes 'entityManager' is a Unity.Entities.EntityManager and you have a CoverageService instance
var coverageService = /* obtain CoverageService from game service locator */;
Bounds1 range = new Bounds1(/* center or min/max values depending on constructor */);
var data = new InfoviewCoverageData {
m_Service = coverageService,
m_Range = range
};
entityManager.AddComponentData(someEntity, data);
// Systems can then query entities with InfoviewCoverageData to perform coverage-specific logic
Notes: - Because this is a plain component (IComponentData), prefer keeping it small and plain-data-only. Reference types (like CoverageService) are allowed but remember they are not job-friendly — systems must handle them on the main thread or use safe patterns for cross-thread access. - IQueryTypeParameter indicates the component is expected to be used as part of query type parameters in the game's ECS systems; consult existing modding examples to see how infoview coverage queries are constructed.