Exemplo n.º 1
0
        //---------------------------------------------------------------------
        public T addComponent <T>() where T : IComponent, new()
        {
            string type_name = EntityMgr.getComponentName <T>();
            T      component = (T)_addComponent(type_name, null, true);

            return(component);
        }
Exemplo n.º 2
0
        //---------------------------------------------------------------------
        public void removeComponent(IComponent component)
        {
            if (component == null)
            {
                return;
            }

            string type_name = EntityMgr.getComponentName(component);

            removeComponent(type_name);
        }
Exemplo n.º 3
0
        //---------------------------------------------------------------------
        public T getComponent <T>() where T : IComponent
        {
            string type_name = EntityMgr.getComponentName <T>();

            if (mMapComponent.ContainsKey(type_name))
            {
                return((T)mMapComponent[type_name]);
            }
            else
            {
                return(default(T));
            }
        }