ientity
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| ientity [2026/08/15 08:16] – diviner | ientity [2026/08/15 08:25] (current) – diviner | ||
|---|---|---|---|
| Line 17: | Line 17: | ||
| Entity creation is handled by the [[IEntityFactory]]. When an Entity is created from a StaticDataID, | Entity creation is handled by the [[IEntityFactory]]. When an Entity is created from a StaticDataID, | ||
| - | * Retrieves the corresponding [[IEntityStaticData|Entity Static Data]]. | + | * Retrieves the corresponding [[IEntityStaticData|EntityStaticData]]. |
| * Examines the Component Static Data contained within it. | * Examines the Component Static Data contained within it. | ||
| * Determines the runtime [[IComponent]] type associated with each Component Static Data type. | * Determines the runtime [[IComponent]] type associated with each Component Static Data type. | ||
| Line 29: | Line 29: | ||
| Conceptually, | Conceptually, | ||
| - | **[[IEntityStaticData|Entity Static Data]] → Component Static Data → [[IComponent|Runtime Components]] → [[IEntity|Entity Instance]]** | + | **[[IEntityStaticData|EntityStaticData]] → ComponentStaticData |
| - | Entity Static Data defines **what an Entity is composed of**, Component Static Data defines the initial configuration of those Components, and the runtime Components contain the changing state of the individual Entity instance. | + | EntityStaticData |
| === Entities and Components === | === Entities and Components === | ||
| Line 43: | Line 43: | ||
| === Static Data ID and Entity Identity === | === Static Data ID and Entity Identity === | ||
| - | The ID stored by [[IEntityStaticData|Entity Static Data]] identifies the **type or definition of Entity being created**, not a unique runtime Entity instance. Multiple Entity instances can be created from the same Entity Static Data and therefore share the same Static Data ID. | + | The ID stored by [[IEntityStaticData|EntityStaticData]] identifies the **type or definition of Entity being created**, not a unique runtime Entity instance. Multiple Entity instances can be created from the same EntityStaticData |
| When an Entity requires a persistent unique runtime identifier, it contains an [[IEntityIdentifierComponent]]. That Component' | When an Entity requires a persistent unique runtime identifier, it contains an [[IEntityIdentifierComponent]]. That Component' | ||
| Line 51: | Line 51: | ||
| There are two internal implementations of [[IEntity]]: | There are two internal implementations of [[IEntity]]: | ||
| - | The [[IEntityFactory]] automatically selects the implementation based on the number of Components defined by the Entity Static Data. | + | The [[IEntityFactory]] automatically selects the implementation based on the number of Components defined by the EntityStaticData. |
| - | * **ArrayEntity** is currently used for Entities with fewer than 10 Components. Components and their Types are stored in arrays and Component lookups perform a small linear search. This avoids the additional overhead of a dictionary for Entities with small Component collections. | + | |
| - | * **SetEntity** is currently used for Entities with 10 or more Components. Components are stored by Type in a dictionary, providing more efficient type-based lookup as the number of Components increases. | + | * **SetEntity** is currently used for Entities with 10 or more Components. Components are stored by Type in a dictionary, providing more efficient type-based lookup as the number of Components increases. |
| This is purely a runtime optimization. Consumers should always interact with [[IEntity]] and should not depend on which concrete implementation the factory selects. | This is purely a runtime optimization. Consumers should always interact with [[IEntity]] and should not depend on which concrete implementation the factory selects. | ||
| Line 68: | Line 68: | ||
| === Properties === | === Properties === | ||
| ^Property | [[IEntityStaticData]] **StaticData** | | ^Property | [[IEntityStaticData]] **StaticData** | | ||
| - | ^Description | Returns the [[IEntityStaticData|Entity Static Data]] from which the Entity was created. This describes the Entity' | + | ^Description | Returns the [[IEntityStaticData|EntityStaticData]] from which the Entity was created. This describes the Entity' |
| === Methods === | === Methods === | ||
| ^Method | void **AddComponents**(Dictionary< | ^Method | void **AddComponents**(Dictionary< | ||
| - | ^Description | Attaches supplied Components to the Entity. This method is primarily used by the [[IEntityFactory]] during Entity construction after the Component collection has been generated from the Entity' | + | ^Description | Attaches supplied Components to the Entity. This method is primarily used by the [[IEntityFactory]] during Entity construction after the Component collection has been generated from the Entity' |
| ^Method | T **GetComponent< | ^Method | T **GetComponent< | ||
ientity.1786781761.txt.gz · Last modified: by diviner
