Class: Kiwi::Internal::ArchStore
- Inherits:
-
Object
- Object
- Kiwi::Internal::ArchStore
- Defined in:
- lib/arch_store.rb
Instance Attribute Summary collapse
-
#compMap ⇒ Object
[[Integer]:Integer].
Instance Method Summary collapse
- #get(archetypeId) ⇒ Object
- #get_archetype_id(componentIds) ⇒ Object
-
#initialize ⇒ ArchStore
constructor
A new instance of ArchStore.
Constructor Details
#initialize ⇒ ArchStore
Returns a new instance of ArchStore.
11 12 13 14 15 16 |
# File 'lib/arch_store.rb', line 11 def initialize # [Archetype] @archetypes = [] # [[ComponentId]:ArchetypeId] @compMap = Hash.new end |
Instance Attribute Details
#compMap ⇒ Object
- [Integer]:Integer
9 10 11 |
# File 'lib/arch_store.rb', line 9 def compMap @compMap end |
Instance Method Details
#get(archetypeId) ⇒ Object
18 19 20 |
# File 'lib/arch_store.rb', line 18 def get(archetypeId) return @archetypes[archetypeId] end |
#get_archetype_id(componentIds) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/arch_store.rb', line 23 def get_archetype_id(componentIds) archId = @compMap[componentIds] if archId != nil return archId else id = @archetypes.size @archetypes.push Archetype.new(componentIds) @compMap[componentIds] = id return id end end |