Game.Areas.Lot
Assembly: Game
Namespace: Game.Areas
Type: struct
Base: IComponentData, IQueryTypeParameter, IEmptySerializable
Summary:
Lot is an empty/tag ECS component used to mark an entity as a "lot" area within the game's entity-component-system. It has no payload; it only serves as a marker. The StructLayout attribute with Size = 1 ensures the type has a non-zero size for interop/serialization and predictable memory layout (useful for Colossal/Unity serialization and to satisfy requirements of IEmptySerializable).
Fields
- This struct declares no instance fields.
Note: The StructLayout(Size = 1) attribute ensures the type occupies one byte even though it carries no data.
Properties
- This struct exposes no properties.
Constructors
public Lot()
The default parameterless constructor is the implicit struct constructor. Because the type is empty, constructing it carries no payload—it's used only to attach the tag to an entity.
Methods
- This type declares no methods.
Usage Example
// Add the tag to an existing entity
var lot = new Game.Areas.Lot();
entityManager.AddComponentData(entity, lot);
// Query for entities that are marked as lots
Entities
.WithAll<Game.Areas.Lot>()
.ForEach((Entity e) =>
{
// e is a lot
}).Run();
{{ Additional notes:
- Implements IComponentData so it can be attached to Unity.Entities entities.
- Implements IQueryTypeParameter allowing it to be used directly in query type parameter lists (WithAll