Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- proc attachComponent*[T](world: var World, entity: Entity, component : T) =
- let id = 1
- #components is a set of int16 currently its empty
- var componentBitset = world.entityInfo[entity].components;
- #world.entityInfo[entity].components.incl(id)
- componentBitset.incl(id)
- #when we leave the code like this we get `components: {}` when we uncomment the other incl we get `(components: {1})`
- echo world.entityInfo[entity]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement