Advertisement
Guest User

Untitled

a guest
Jan 25th, 2020
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nim 0.44 KB | None | 0 0
  1. proc attachComponent*[T](world: var World, entity: Entity, component : T)  =
  2.     let id  = 1
  3.  
  4.     #components is a set of int16 currently its empty
  5.     var componentBitset =  world.entityInfo[entity].components;
  6.  
  7.     #world.entityInfo[entity].components.incl(id)
  8.     componentBitset.incl(id)
  9.  
  10.     #when we leave the code like this we get `components: {}` when we uncomment the other incl we get `(components: {1})`
  11.     echo world.entityInfo[entity]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement