Game Develop C++ Platform: ObjectHelpers.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
ObjectHelpers.h
Go to the documentation of this file.
1
9 #ifndef OBJECTHELPERS_H
10 #define OBJECTHELPERS_H
11 #include "GDCpp/Object.h"
12 #include "GDCpp/RuntimeObject.h"
13 #include <boost/shared_ptr.hpp>
14 #include <vector>
15
19 typedef std::vector < boost::shared_ptr<RuntimeObject> > RuntimeObjList;
20
24 typedef boost::shared_ptr<RuntimeObject> RuntimeObjSPtr;
25
31 struct ObjectHasName : public std::binary_function<boost::shared_ptr<gd::Object>, std::string, bool> {
32 bool operator()(const boost::shared_ptr<gd::Object> & object, const std::string & name) const { return object->GetName() == name; }
33 };
34
40 struct SortByZOrder
41 {
42 bool operator ()(RuntimeObjSPtr o1, RuntimeObjSPtr o2) const
43 {
44 return o1->GetZOrder() < o2->GetZOrder();
45 }
46 };
47
48 #endif // OBJECTHELPERS_H
49