Game.Prefabs.ActivityLocationData
Assembly: Assembly-CSharp
Namespace: Game.Prefabs
Type: struct
Base: System.ValueType, implements Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter
Summary:
ActivityLocationData is a lightweight ECS component used to mark "activity location" prefabs/entities with the set of activities supported at that location. It wraps an ActivityMask (a bitmask/flags type used by the game to represent activity categories) so systems can query and match locations to citizens' desired activities.
Fields
public ActivityMask m_ActivityMask
Holds the mask/flags representing which activities are available at this location. Systems read this to decide whether a location satisfies a requested activity (e.g., shopping, entertainment). The exact values and meaning come from the ActivityMask type (not shown here).
Properties
- None. This struct exposes a single public field and defines no properties.
Constructors
public ActivityLocationData()
No explicit constructor is defined in the source. The default value-type constructor is used; initialize via object initializer when adding the component.
Methods
- None. The struct contains no methods; it only stores data and implements marker/query interfaces for ECS.
Usage Example
// Add the component to an entity (EntityManager example)
var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
var myMask = /* obtain or build an ActivityMask value representing allowed activities */;
entityManager.AddComponentData(myEntity, new ActivityLocationData { m_ActivityMask = myMask });
// Querying locations in a system (EntityQuery / ForEach style)
Entities
.WithAll<ActivityLocationData>()
.ForEach((ref ActivityLocationData location) =>
{
var mask = location.m_ActivityMask;
// check mask against desired activity, e.g.:
// if ((mask & desiredActivity) != 0) { ... }
}).Schedule();
Notes and tips: - ActivityMask is the key piece: consult its definition to know which bits correspond to which activity types. - Because this is an IComponentData struct, it is cheap to store in large numbers and intended for use in DOTS/ECS queries. - Implementing IQueryTypeParameter indicates it can be used as part of ECS query parameterization patterns; use it in queries to filter or read activity-location data efficiently.