Class EntityStore
- Namespace
- TDMaker.Core
- Assembly
- TDMaker.Core.dll
Deferred entity storage with stable iteration order and prewarmed component bundles.
public sealed class EntityStore
- Inheritance
-
EntityStore
- Inherited Members
Properties
All
Committed entities, ordered by ascending Id.
public IReadOnlyList<Entity> All { get; }
Property Value
AvailableCapacity
Unused prewarmed entity bundles, including all component arrays.
public int AvailableCapacity { get; }
Property Value
Enemies
Committed enemy index.
public IReadOnlyList<Entity> Enemies { get; }
Property Value
Heroes
Committed independent heroes, also included in Soldiers.
public IReadOnlyList<Entity> Heroes { get; }
Property Value
PendingCount
Number of pending noncancelled insertions.
public int PendingCount { get; }
Property Value
Projectiles
Committed projectile index.
public IReadOnlyList<Entity> Projectiles { get; }
Property Value
Soldiers
Committed soldier index.
public IReadOnlyList<Entity> Soldiers { get; }
Property Value
Towers
Committed tower index.
public IReadOnlyList<Entity> Towers { get; }
Property Value
Methods
Flush()
Commits queued removals and spawns; Simulation calls this once at each tick end.
public void Flush()
Get(int)
Finds committed or pending entities. Removed identifiers always return null.
public Entity Get(int id)
Parameters
idint
Returns
Remove(int)
Queues removal, including pending spawns, and releases owned soldiers.
public void Remove(int id)
Parameters
idint
Spawn(string, Vec2)
Queues an unindexed template entity at a position; use commands or SpawnEnemy for indexed roles.
public Entity Spawn(string templateId, Vec2 position)