1 | #include "test1.h" |
---|
2 | #include "test2.h" |
---|
3 | #include "test3.h" |
---|
4 | |
---|
5 | namespace orxonox |
---|
6 | { |
---|
7 | CreateFactory(Test1); |
---|
8 | |
---|
9 | Test1::Test1() |
---|
10 | { |
---|
11 | RegisterObject(Test1); |
---|
12 | |
---|
13 | this->usefullClass1_ = Class(Test1); |
---|
14 | this->usefullClass2_ = Class(Test2); |
---|
15 | this->usefullClass3_ = Class(Test3); |
---|
16 | } |
---|
17 | |
---|
18 | Test1::~Test1() |
---|
19 | { |
---|
20 | } |
---|
21 | |
---|
22 | void Test1::tick(float dt) |
---|
23 | { |
---|
24 | std::cout << "Test1: " << this << "\n"; |
---|
25 | } |
---|
26 | |
---|
27 | bool Test1::usefullClass1isA(Identifier* identifier) |
---|
28 | { |
---|
29 | return this->usefullClass1_->isA(identifier); |
---|
30 | } |
---|
31 | |
---|
32 | bool Test1::usefullClass2isA(Identifier* identifier) |
---|
33 | { |
---|
34 | return this->usefullClass2_->isA(identifier); |
---|
35 | } |
---|
36 | |
---|
37 | bool Test1::usefullClass3isA(Identifier* identifier) |
---|
38 | { |
---|
39 | return this->usefullClass3_.isA(identifier); |
---|
40 | } |
---|
41 | |
---|
42 | void Test1::setUsefullClass1(Identifier* identifier) |
---|
43 | { |
---|
44 | std::cout << "\n"; |
---|
45 | std::cout << "Test1: usefullClass1->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n"; |
---|
46 | std::cout << "Test1: usefullClass1->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n"; |
---|
47 | std::cout << "Test1: usefullClass1->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n"; |
---|
48 | this->usefullClass1_ = identifier; |
---|
49 | } |
---|
50 | |
---|
51 | void Test1::setUsefullClass2(Identifier* identifier) |
---|
52 | { |
---|
53 | std::cout << "\n"; |
---|
54 | std::cout << "Test1: usefullClass2->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n"; |
---|
55 | std::cout << "Test1: usefullClass2->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n"; |
---|
56 | std::cout << "Test1: usefullClass2->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n"; |
---|
57 | this->usefullClass2_ = identifier; |
---|
58 | } |
---|
59 | |
---|
60 | void Test1::setUsefullClassOfTypeTest3(Identifier* identifier) |
---|
61 | { |
---|
62 | std::cout << "\n"; |
---|
63 | std::cout << "Test1: usefullClass3->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n"; |
---|
64 | std::cout << "Test1: usefullClass3->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n"; |
---|
65 | std::cout << "Test1: usefullClass3->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n"; |
---|
66 | this->usefullClass3_ = identifier; |
---|
67 | } |
---|
68 | } |
---|