Game.Buildings.StudentsRemoved
Assembly: Assembly-CSharp
Namespace: Game.Buildings
Type: struct
Base: System.ValueType, IComponentData, IQueryTypeParameter, IEmptySerializable
Summary: StudentsRemoved is an empty marker (tag) component used by the game's DOTS-based systems to mark an entity (typically a building) where students have been removed or a student-related state has been recorded. The struct is decorated with [StructLayout(LayoutKind.Sequential, Size = 1)] to force a non-zero size for serialization/interop and to ensure compatibility with systems that require a concrete (non-zero-size) component for serialization and querying.
Fields
- This struct contains no instance fields; it is a marker/flag component only. {{ This empty struct intentionally has no fields. The explicit StructLayout(Size = 1) makes the component occupy one byte so it can be serialized and used reliably as a queryable component in DOTS. }}
Properties
- None. {{ As an empty marker component, StudentsRemoved exposes no properties. It simply implements the interfaces needed for ECS usage and serialization. }}
Constructors
public StudentsRemoved()
{{ Structs have an implicit parameterless constructor generated by the runtime. Use the default value (new StudentsRemoved()) when adding this component to an entity. The explicit StructLayout attribute does not change construction semantics. }}
Methods
- None. {{ There are no methods defined on this type. It is intended only for use as a queryable/serializable flag. }}
Usage Example
// Add the marker to an entity (EntityManager API)
entityManager.AddComponentData(entity, new Game.Buildings.StudentsRemoved());
// Remove the marker
entityManager.RemoveComponent<Game.Buildings.StudentsRemoved>(entity);
// Query for entities that have the marker (EntityQuery)
var query = entityManager.CreateEntityQuery(ComponentType.ReadOnly<Game.Buildings.StudentsRemoved>());
// Using SystemBase / Entities.ForEach to act on marked entities
public partial class HandleStudentsRemovedSystem : SystemBase
{
protected override void OnUpdate()
{
Entities
.WithAll<Game.Buildings.StudentsRemoved>()
.ForEach((Entity e, in SomeOtherComponent comp) =>
{
// Handle building which has StudentsRemoved marker...
// Optionally remove the marker when handled:
// EntityManager.RemoveComponent<Game.Buildings.StudentsRemoved>(e);
})
.Schedule();
}
}
{{ This component is intended as a lightweight tag for systems to detect and process buildings involved in student removal logic. Because it implements IEmptySerializable, it will be included in the game's entity serialization flow. }}