Skip to content

Major Changes

Compare
Choose a tag to compare
@realtradam realtradam released this 10 Jul 07:17
· 31 commits to master since this release

Changed

  • Entities and Components now reference each other using the objects themselves rather then their id's
# before:
@entity.components[@component_manager].each do |component_id|
  # iterate over id's, usually would need to do a lookup to get the component itself
end

# after:
@entity.components[@component_manager].each do |component|
  # iterate over the components themselves! No need for lookup anymore
end
# same for components referencing entities
# before:
@component.entities.each do |entity_id|
  #iterate over id's
end

# after:
@component.entities.each do |entity|
  # directly iterate over entities themselves!
end