class CES::ComponentReference

component reference - which entities have which components

Public Class Methods

components() click to toggle source

allow reading of all components

# File lib/entity.rb, line 43
def self.components
        return @@components
end
loadedcomponents(components = []) click to toggle source

allow Component.loadcomponents to add components to ComponentReference

# File lib/entity.rb, line 33
def self.loadedcomponents(components = [])
        components.each { |component|
                @@components[component["meta"]["name"]] = {
                        "component" => component,
                        "entities" => []
                }
        }
end
register(component, eid) click to toggle source

allow adding of EIDs to component eid list component -> name, eid -> number

# File lib/entity.rb, line 49
def self.register(component, eid)
        @@components[component]["entities"].push(eid)
end
unregister(component, eid) click to toggle source

remove eid from component's list

# File lib/entity.rb, line 53
def self.unregister(component, eid)
        @@components[component]["entities"].delete(eid)
end