-
-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
I would like to add prefabs and inheritance. Something like this:
>>> world = tcod.ecs.World()
>>> world["orc"].components[("atk", int)] = 4
>>> monster = world["orc"].instantiate() # New entity with is-a relation
>>> monster.components[("atk", int)] # Takes atk from parent
4
>>> monster.components(traverse=())[("atk", int)] # Missing when traversal is disabled
KeyError
>>> monster.components[("atk", int)] += 1 # Typical copy-on-write
>>> monster.components(traverse=())[("atk", int)]
5
I'm in the middle of refactoring queries, and once that is done I'll be able to add relationship traversal and then I can make an IsA
sentinel value which will be the default traversal option for all queries and lookups.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request