Game.Routes.HiddenRoute
Assembly: Assembly-CSharp
Namespace: Game.Routes
Type: struct
Base: System.ValueType, implements Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter, Colossal.Serialization.Entities.IEmptySerializable
Summary:
HiddenRoute is an empty/tag ECS component used to mark routes as "hidden" within the game's entity system. The struct is explicitly laid out with Size = 1 to ensure a non-zero size for serialization and interop purposes. It is intended to be used as a marker in queries and component checks rather than carrying data.
Fields
- (none)
This is an intentionally empty struct (a tag component). The [StructLayout(LayoutKind.Sequential, Size = 1)] attribute gives it a 1-byte size for serialization and native interop.
Properties
- (none)
As a plain tag component, HiddenRoute exposes no properties.
Constructors
public HiddenRoute()
Implicit parameterless constructor generated for the struct. Use instances of this type as a marker (new HiddenRoute()) when adding the component to entities.
Methods
- (none)
No methods are defined on this type. Behavior is provided by systems that query for the presence/absence of this component.
Usage Example
// Add the tag component to an entity
entityManager.AddComponentData(entity, new HiddenRoute());
// Check if an entity has the hidden route tag
if (entityManager.HasComponent<HiddenRoute>(entity))
{
// handle hidden route
}
// Query for entities with the tag
var query = entityManager.CreateEntityQuery(typeof(HiddenRoute));
// iterate or process matching entities...
{{ Additional notes: - The IEmptySerializable interface indicates the type participates in Colossal's custom serialization for empty/marker components. - The IQueryTypeParameter implementation allows this type to be used directly in ECS queries and query parameter lists. - Because the struct carries no data, it is cheap to add/remove and ideal for boolean/toggle semantics in ECS. }}