Changeset 540 for trunk/nv/ecs/ecs.hh


Ignore:
Timestamp:
01/25/17 20:20:45 (8 years ago)
Author:
epyon
Message:
  • lua::stack_proxy RTTI read support
  • missing RTTI declarations
  • new lua::table_guard syntax
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/nv/ecs/ecs.hh

    r537 r540  
    2626{
    2727
     28        namespace lua
     29        {
     30                class stack_proxy;
     31        }
     32
    2833        namespace ecs
    2934        {
     
    6570                        {
    6671                        public:
     72                                virtual void initialize( handle_type, lua::stack_proxy& ) = 0;
    6773                                virtual void remove( handle_type h ) = 0;
    6874                                virtual void* get_raw( handle_type h ) = 0;
     
    109115                                register_receiver( name, c );
    110116                                m_component_map[thash64::create<Component>()] = c;
     117                                m_component_map_by_name[name] = c;
    111118                        }
    112119
     
    249256                        }
    250257
     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
    251270                        template < typename Component >
    252271                        Component* get( handle_type h )
     
    267286                        vector< receiver_interface* >               m_receivers;
    268287                        hash_store< thash64, component_interface* > m_component_map;
     288                        hash_store< shash64, component_interface* > m_component_map_by_name;
    269289                        time_type                                   m_time = time_type(0);
    270290                        priority_queue< message, vector< message >, message_compare_type > m_pqueue;
Note: See TracChangeset for help on using the changeset viewer.