Game.Prefabs.ChirperAccountData
Assembly:
Assembly-CSharp (game/main assembly)
Namespace:
Game.Prefabs
Type:
struct
Base:
System.ValueType
Implements: Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter
Summary:
A marker/tag component used to mark entities that represent a Chirper account (the in-game social media/accounts system). The struct is empty by design — it carries no runtime fields — and uses StructLayout with Size = 1 so it is not treated as a zero-sized type at the native level. Implementing IQueryTypeParameter indicates it can be used as a type parameter in ECS queries/filters.
Fields
- This component defines no instance fields. It is an empty/tag component.
Notes: - The [StructLayout(LayoutKind.Sequential, Size = 1)] attribute forces the component to occupy at least 1 byte in memory. This can be useful to avoid special-casing zero-sized components in some native storage scenarios.
Properties
- This component exposes no properties.
Constructors
public ChirperAccountData()
(implicit default parameterless constructor)
This is the default value-type constructor. No initialization logic is required or present.
Methods
- This component declares no methods.
Usage Example
// Add the tag to an existing entity
EntityManager.AddComponentData(entity, new Game.Prefabs.ChirperAccountData());
// Querying entities that have the tag using SystemBase / Entities.ForEach
Entities
.WithAll<Game.Prefabs.ChirperAccountData>()
.ForEach((Entity e) =>
{
// Process chirper account entities
}).ScheduleParallel();
// Alternative: using IQueryTypeParameter in a query lambda (depending on API)
Entities
.WithAll<ChirperAccountData>()
.ForEach((ref SomeOtherComponent comp) =>
{
// ...
}).Schedule();
Additional modding notes: - Since the component is a pure tag, adding/removing it is the intended way to mark an entity as a Chirper account. - Because there is no stored data, functionality tied to Chirper accounts will be implemented in systems that check for this component and operate on other components or shared/singleton data. - The use of Size = 1 avoids potential edge-cases with zero-sized types when interfacing with lower-level native code or serialization.