1 | #include "test1.h" |
---|
2 | #include "test2.h" |
---|
3 | #include "test3.h" |
---|
4 | #include "../../tinyxml/tinyxml.h" |
---|
5 | #include "../orxonox.h" |
---|
6 | #include <OgreSceneManager.h> |
---|
7 | |
---|
8 | namespace orxonox |
---|
9 | { |
---|
10 | CreateFactory(Test1); |
---|
11 | |
---|
12 | Test1::Test1() |
---|
13 | { |
---|
14 | RegisterObject(Test1); |
---|
15 | |
---|
16 | this->usefullClass1_ = Class(Test1); |
---|
17 | this->usefullClass2_ = Class(Test2); |
---|
18 | this->usefullClass3_ = Class(Test3); |
---|
19 | } |
---|
20 | |
---|
21 | Test1::~Test1() |
---|
22 | { |
---|
23 | } |
---|
24 | |
---|
25 | void Test1::tick(float dt) |
---|
26 | { |
---|
27 | std::cout << "Test1: " << this << "\n"; |
---|
28 | } |
---|
29 | |
---|
30 | bool Test1::usefullClass1isA(Identifier* identifier) |
---|
31 | { |
---|
32 | return this->usefullClass1_->isA(identifier); |
---|
33 | } |
---|
34 | |
---|
35 | bool Test1::usefullClass2isA(Identifier* identifier) |
---|
36 | { |
---|
37 | return this->usefullClass2_->isA(identifier); |
---|
38 | } |
---|
39 | |
---|
40 | bool Test1::usefullClass3isA(Identifier* identifier) |
---|
41 | { |
---|
42 | return this->usefullClass3_.isA(identifier); |
---|
43 | } |
---|
44 | |
---|
45 | void Test1::setUsefullClass1(Identifier* identifier) |
---|
46 | { |
---|
47 | std::cout << "\n"; |
---|
48 | std::cout << "Test1: usefullClass1->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n"; |
---|
49 | std::cout << "Test1: usefullClass1->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n"; |
---|
50 | std::cout << "Test1: usefullClass1->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n"; |
---|
51 | this->usefullClass1_ = identifier; |
---|
52 | } |
---|
53 | |
---|
54 | void Test1::setUsefullClass2(Identifier* identifier) |
---|
55 | { |
---|
56 | std::cout << "\n"; |
---|
57 | std::cout << "Test1: usefullClass2->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n"; |
---|
58 | std::cout << "Test1: usefullClass2->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n"; |
---|
59 | std::cout << "Test1: usefullClass2->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n"; |
---|
60 | this->usefullClass2_ = identifier; |
---|
61 | } |
---|
62 | |
---|
63 | void Test1::setUsefullClassOfTypeTest3(Identifier* identifier) |
---|
64 | { |
---|
65 | std::cout << "\n"; |
---|
66 | std::cout << "Test1: usefullClass3->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n"; |
---|
67 | std::cout << "Test1: usefullClass3->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n"; |
---|
68 | std::cout << "Test1: usefullClass3->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n"; |
---|
69 | this->usefullClass3_ = identifier; |
---|
70 | } |
---|
71 | |
---|
72 | void Test1::loadParams(TiXmlElement* xmlElem) |
---|
73 | { |
---|
74 | Ogre::SceneManager* mgr = orxonox::Orxonox::getSingleton()->getSceneManager(); |
---|
75 | |
---|
76 | mgr->setAmbientLight(ColourValue(1,0,0)); |
---|
77 | |
---|
78 | |
---|
79 | |
---|
80 | std::cout<< xmlElem->GetText()<<std::endl; |
---|
81 | |
---|
82 | |
---|
83 | } |
---|
84 | } |
---|