Game.LocalEffectProvider
Assembly:
Game (in-game assembly; may also appear in Assembly-CSharp depending on build)
Namespace:
Game.Buildings
Type:
struct
Base:
IComponentData, IQueryTypeParameter, IEmptySerializable
Summary:
Marker/tag component used by the game's ECS to identify building-related entities that act as local effect providers (e.g., for localized visual or audio effects tied to a building). The struct is empty by design and carries no runtime state; it enables queries and serialization handling for entities that should be treated as providers of local effects. The StructLayout attribute forces a size of 1 byte so the type is non-zero-sized for interop/serialization purposes.
Fields
- None
This is an empty value-type component with no instance fields. The [StructLayout(LayoutKind.Sequential, Size = 1)] attribute is present to give it a concrete size for serialization/interop.
Properties
- None
Implements IComponentData/IQueryTypeParameter/IEmptySerializable as markers; it exposes no properties.
Constructors
public LocalEffectProvider()
Implicit default parameterless constructor (value type). There is no custom initialization required.
Methods
- None
No methods are defined. The implemented interfaces are marker interfaces used by the ECS and the game's serialization system (Colossal.Serialization).
Usage Example
// Add the marker component to an entity so it can be queried as a local effect provider.
EntityManager em = World.DefaultGameObjectInjectionWorld.EntityManager;
Entity entity = em.CreateEntity();
// Mark the entity as a LocalEffectProvider
em.AddComponentData(entity, new Game.Buildings.LocalEffectProvider());
// Later, you can create an EntityQuery that filters for entities with this tag:
var query = em.CreateEntityQuery(ComponentType.ReadOnly<Game.Buildings.LocalEffectProvider>());
Additional notes: - The IEmptySerializable interface and the presence of Colossal.Serialization.Entities in the source indicate integration with the game's custom serialization system; the explicit 1-byte size helps ensure the component is serialized/handled consistently. - Use this component purely as a tag. Any per-instance data for effects should be stored in separate components.