Game.Net.Marker
Assembly: Assembly-CSharp (game executable / mod assembly — verify in your build)
Namespace: Game.Net
Type: struct
Base: IComponentData, IQueryTypeParameter, IEmptySerializable
Summary:
Marker is an empty (zero-data) ECS tag component used to mark/tag entities for network-related logic. The struct is decorated with [StructLayout(LayoutKind.Sequential, Size = 1)] to force a non-zero size (1 byte) so it can be safely serialized/interoped. It implements Unity.Entities.IComponentData so it can be attached to entities, IQueryTypeParameter to be used conveniently in queries/jobs, and Colossal.Serialization.Entities.IEmptySerializable to indicate special handling by the game's serialization system.
Fields
- (none — the struct declares no managed fields)
The struct's byte size is enforced by the StructLayout attribute (Size = 1). No runtime-stored fields are present — this is a pure tag component.
Properties
- (none)
No properties are defined; this component carries no data beyond its presence on an entity.
Constructors
- Implicit parameterless/default constructor (Marker)
As a value type, Marker can be created with default(Marker) or new Marker(). There is no custom constructor defined.
Methods
- (none)
No methods are defined. The implemented interfaces are marker/behavioral interfaces used by the ECS and the game's serialization system.
Usage Example
// Add the marker to an entity
var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
Entity e = entityManager.CreateEntity();
entityManager.AddComponentData(e, new Game.Net.Marker());
// Create a query that selects entities tagged with Marker
var markerQuery = entityManager.CreateEntityQuery(ComponentType.ReadOnly<Game.Net.Marker>());
// Use the marker in a System's Entities.ForEach (tag-only usage)
Entities
.WithAll<Game.Net.Marker>()
.ForEach((Entity entity) =>
{
// Do something for tagged entities
})
.Schedule();
Notes: - Use this component when you need to tag entities for networking, filtering, or to drive systems that operate on a subset of entities. - The StructLayout(Size = 1) ensures the struct is non-zero-sized for serialization and interop with native code. - IEmptySerializable indicates the game/Colossal framework treats the component as an empty-serializable type; avoid adding fields unless you also implement appropriate serialization behavior.