Changeset 540 for trunk/nv/ecs/ecs.hh
- Timestamp:
- 01/25/17 20:20:45 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nv/ecs/ecs.hh
r537 r540 26 26 { 27 27 28 namespace lua 29 { 30 class stack_proxy; 31 } 32 28 33 namespace ecs 29 34 { … … 65 70 { 66 71 public: 72 virtual void initialize( handle_type, lua::stack_proxy& ) = 0; 67 73 virtual void remove( handle_type h ) = 0; 68 74 virtual void* get_raw( handle_type h ) = 0; … … 109 115 register_receiver( name, c ); 110 116 m_component_map[thash64::create<Component>()] = c; 117 m_component_map_by_name[name] = c; 111 118 } 112 119 … … 249 256 } 250 257 258 component_interface* get_component( shash64 component_name ) 259 { 260 auto it = m_component_map_by_name.find( component_name ); 261 return it != m_component_map_by_name.end() ? it->second : nullptr; 262 } 263 264 const component_interface* get_component( shash64 component_name ) const 265 { 266 auto it = m_component_map_by_name.find( component_name ); 267 return it != m_component_map_by_name.end() ? it->second : nullptr; 268 } 269 251 270 template < typename Component > 252 271 Component* get( handle_type h ) … … 267 286 vector< receiver_interface* > m_receivers; 268 287 hash_store< thash64, component_interface* > m_component_map; 288 hash_store< shash64, component_interface* > m_component_map_by_name; 269 289 time_type m_time = time_type(0); 270 290 priority_queue< message, vector< message >, message_compare_type > m_pqueue;
Note: See TracChangeset
for help on using the changeset viewer.