Entity¶
This module contains the definition of entities. It has the abstract definition of Entity. Entities are elements with identity and properties.
Example
Creating an entity:
class Model(Entity):
_count: NumberProperty
def __init__(self, name: str):
super().__init__(name)
self._count = NumberProperty(0)
def get_properties(self) -> EntityProperties:
return {
'count': self._count
}
-
class
gsf.core.entity.core.entity.
Entity
(name: str, entity_manager: Optional[gsf.core.entity.core.entity_manager.EntityManager] = None)¶ Bases:
object
Unique component with an identification.
-
_id
¶ Identifier of the entity.
- Type
str
-
_entity_manager
¶ Delegated entity manager.
- Type
-
get_id
() → str¶ Gets the identifier of the entity.
-
abstract
get_properties
() → Dict[str, gsf.core.entity.core.entity_property.EntityProperty]¶ Lists the properties of the entity
-
set_id
(name: str)¶ Sets the identifier of the entity.
- Parameters
name (str) – Identifier of the entity.
-