- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
template <typename T> std::list<T*> GetComponents(){
        std::list<T*> list;
        std::list<Component_ptr>::iterator iter=_components.begin();
        while(iter!=_components.end()){
            T* element=dynamic_cast<T*>(iter->get());
            if(element!=NULL){
                list.push_back(element);
            }
            iter++;
        }
        return list;
    }
    template <typename T> T* GetComponent(){
        std::list<T*> list=GetComponents<T>();
        if(list.size()>0){
            return list.front();
        }
        return NULL;
    }
 Follow us!
 Follow us!
Комментарии (11) RSS
Добавить комментарий