Changeset 384 for code/branches/FICN/src/orxonox/objects
- Timestamp:
- Dec 4, 2007, 11:48:28 PM (17 years ago)
- Location:
- code/branches/FICN/src/orxonox/objects
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/orxonox/objects/BaseObject.h
r341 r384 2 2 #define _BaseObject_H__ 3 3 4 #include " orxonox/core/IdentifierIncludes.h"4 #include "../core/IdentifierIncludes.h" 5 5 6 6 namespace orxonox … … 11 11 BaseObject(); 12 12 virtual ~BaseObject(); 13 14 inline bool isA(const Identifier* identifier)15 { this->getIdentifier()->isA(identifier); }16 inline bool isDirectlyA(const Identifier* identifier)17 { this->getIdentifier()->isDirectlyA(identifier); }18 inline bool isChildOf(const Identifier* identifier)19 { this->getIdentifier()->isChildOf(identifier); }20 inline bool isParentOf(const Identifier* identifier)21 { this->getIdentifier()->isParentOf(identifier); }22 23 inline bool isA(const SubclassIdentifier<class B>* identifier)24 { this->getIdentifier()->isA(identifier->getIdentifier()); }25 inline bool isDirectlyA(const SubclassIdentifier<class B>* identifier)26 { this->getIdentifier()->isDirectlyA(identifier->getIdentifier()); }27 inline bool isChildOf(const SubclassIdentifier<class B>* identifier)28 { this->getIdentifier()->isChildOf(identifier->getIdentifier()); }29 inline bool isParentOf(const SubclassIdentifier<class B>* identifier)30 { this->getIdentifier()->isParentOf(identifier->getIdentifier()); }31 32 inline bool isA(const SubclassIdentifier<class B> identifier)33 { this->getIdentifier()->isA(identifier.getIdentifier()); }34 inline bool isDirectlyA(const SubclassIdentifier<class B> identifier)35 { this->getIdentifier()->isDirectlyA(identifier.getIdentifier()); }36 inline bool isChildOf(const SubclassIdentifier<class B> identifier)37 { this->getIdentifier()->isChildOf(identifier.getIdentifier()); }38 inline bool isParentOf(const SubclassIdentifier<class B> identifier)39 { this->getIdentifier()->isParentOf(identifier.getIdentifier()); }40 41 inline bool isA(const OrxonoxClass* object)42 { this->getIdentifier()->isA(object->getIdentifier()); }43 inline bool isDirectlyA(const OrxonoxClass* object)44 { this->getIdentifier()->isDirectlyA(object->getIdentifier()); }45 inline bool isChildOf(const OrxonoxClass* object)46 { this->getIdentifier()->isChildOf(object->getIdentifier()); }47 inline bool isParentOf(const OrxonoxClass* object)48 { this->getIdentifier()->isParentOf(object->getIdentifier()); }49 50 std::string name_; // test51 52 13 }; 53 14 } -
code/branches/FICN/src/orxonox/objects/test1.cc
r258 r384 18 18 Test1::~Test1() 19 19 { 20 } 21 22 void Test1::tick(float dt) 23 { 24 std::cout << "Test1: " << this << "\n"; 20 25 } 21 26 -
code/branches/FICN/src/orxonox/objects/test1.h
r258 r384 3 3 4 4 #include "BaseObject.h" 5 #include "Tickable.h" 5 6 #include "test3.h" 6 7 7 8 namespace orxonox 8 9 { 9 class Test1 : public BaseObject 10 class Test1 : public BaseObject, public Tickable 10 11 { 11 12 public: 12 13 Test1(); 13 14 virtual ~Test1(); 15 16 virtual void tick(float dt); 14 17 15 18 bool usefullClass1isA(Identifier* identifier); -
code/branches/FICN/src/orxonox/objects/test2.cc
r258 r384 14 14 this->usefullClass2_ = Class(Test2); 15 15 this->usefullClass3_ = Class(Test3); 16 17 timer1.setTimer(1, true, this, &Test2::timerFunction1); 18 timer2.setTimer(5, true, this, &Test2::timerFunction2); 19 timer3.setTimer(10, false, this, &Test2::timerFunction3); 16 20 } 17 21 18 22 Test2::~Test2() 19 23 { 24 } 25 26 void Test2::timerFunction1() 27 { 28 std::cout << "Test2: 1 Sekunde\n"; 29 } 30 31 void Test2::timerFunction2() 32 { 33 std::cout << "Test2: 5 Sekunden\n"; 34 } 35 36 void Test2::timerFunction3() 37 { 38 std::cout << "Test2: 10 Sekunden sind um!\n"; 20 39 } 21 40 -
code/branches/FICN/src/orxonox/objects/test2.h
r258 r384 3 3 4 4 #include "BaseObject.h" 5 #include "Timer.h" 5 6 6 7 namespace orxonox … … 21 22 void setUsefullClassOfTypeTest3(Identifier* identifier); 22 23 24 void timerFunction1(); 25 void timerFunction2(); 26 void timerFunction3(); 27 23 28 private: 24 29 Identifier* usefullClass1_; … … 26 31 SubclassIdentifier<Test3> usefullClass3_; 27 32 33 Timer<Test2> timer1; 34 Timer<Test2> timer2; 35 Timer<Test2> timer3; 28 36 }; 29 37 }
Note: See TracChangeset
for help on using the changeset viewer.