Game Develop C++ Platform: SourceFileCommonTools.h Source File

| Game Develop C++ Platform Platform for developing native games based on OpenGL and SFML with Game Develop

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Groups Pages
SourceFileCommonTools.h
1
6 //Extensions writers: Please do not use these functions: There are meant to be used
7 //for ease the writing
8
9 #include <vector>
10 #include "GDCpp/RuntimeObject.h"
11
18 template<typename T>
19 std::vector<T*> GetSpecificObjects( const std::vector<RuntimeObject*> & objectsList )
20 {
21 std::vector<T*> specializedObjects;
22 specializedObjects.reserve(objectsList.size());
23
24 for (unsigned int i = 0;i<objectsList.size();++i)
25 {
26 T * specializedObject = dynamic_cast<T*>(objectsList[i]);
27 if ( specializedObject != NULL ) specializedObjects.push_back(specializedObject);
28 }
29
30 return specializedObjects;
31 }