[197] | 1 | #include "test1.h" |
---|
| 2 | #include "test2.h" |
---|
| 3 | #include "test3.h" |
---|
| 4 | |
---|
| 5 | namespace orxonox |
---|
| 6 | { |
---|
[218] | 7 | CreateFactory(Test3); |
---|
| 8 | |
---|
[197] | 9 | Test3::Test3() |
---|
| 10 | { |
---|
[244] | 11 | RegisterObject(Test3); |
---|
[496] | 12 | |
---|
| 13 | this->setConfigValues(); |
---|
[197] | 14 | } |
---|
| 15 | |
---|
[496] | 16 | void Test3::setConfigValues() |
---|
| 17 | { |
---|
| 18 | SetConfigValue(value_int_, -100); |
---|
| 19 | SetConfigValue(value_double_, 10.555678); |
---|
| 20 | SetConfigValue(value_bool_, true); |
---|
| 21 | SetConfigValue(value_string_, "Dies ist ein Test"); |
---|
| 22 | SetConfigValue(value_vector2_, Vector2(101, 202)); |
---|
| 23 | SetConfigValue(value_vector3_, Vector3(13, 26, 39)); |
---|
| 24 | SetConfigValue(value_colourvalue_, ColourValue(1.0, 0.5, 0.25, 0.887)); |
---|
| 25 | } |
---|
| 26 | |
---|
[197] | 27 | Test3::~Test3() |
---|
| 28 | { |
---|
| 29 | } |
---|
[496] | 30 | |
---|
| 31 | #include <fstream> |
---|
| 32 | void Test3::configOutput() |
---|
| 33 | { |
---|
| 34 | std::cout << this->value_int_ << std::endl; |
---|
| 35 | std::cout << this->value_double_ << std::endl; |
---|
| 36 | std::cout << this->value_bool_ << std::endl; |
---|
| 37 | std::cout << this->value_string_ << std::endl; |
---|
| 38 | std::cout << this->value_vector2_ << std::endl; |
---|
| 39 | std::cout << this->value_vector3_ << std::endl; |
---|
| 40 | std::cout << this->value_colourvalue_ << std::endl; |
---|
| 41 | } |
---|
| 42 | |
---|
[197] | 43 | #define testandcout(code) \ |
---|
| 44 | std::cout << #code << " " << code << "\n" |
---|
| 45 | |
---|
[356] | 46 | void Test3::usefullClassesIsATest(Test1* test1) |
---|
[197] | 47 | { |
---|
| 48 | std::cout << "\n"; |
---|
| 49 | std::cout << "Test1:\n"; |
---|
| 50 | testandcout(test1->usefullClass1isA(Class(Test1))); |
---|
| 51 | testandcout(test1->usefullClass1isA(Class(Test2))); |
---|
| 52 | testandcout(test1->usefullClass1isA(Class(Test3))); |
---|
| 53 | std::cout << "\n"; |
---|
| 54 | testandcout(test1->usefullClass2isA(Class(Test1))); |
---|
| 55 | testandcout(test1->usefullClass2isA(Class(Test2))); |
---|
| 56 | testandcout(test1->usefullClass2isA(Class(Test3))); |
---|
| 57 | std::cout << "\n"; |
---|
| 58 | testandcout(test1->usefullClass3isA(Class(Test1))); |
---|
| 59 | testandcout(test1->usefullClass3isA(Class(Test2))); |
---|
| 60 | testandcout(test1->usefullClass3isA(Class(Test3))); |
---|
| 61 | } |
---|
| 62 | |
---|
[356] | 63 | void Test3::usefullClassesIsATest(Test2* test2) |
---|
[197] | 64 | { |
---|
| 65 | std::cout << "\n"; |
---|
| 66 | std::cout << "Test2:\n"; |
---|
| 67 | testandcout(test2->usefullClass1isA(Class(Test1))); |
---|
| 68 | testandcout(test2->usefullClass1isA(Class(Test2))); |
---|
| 69 | testandcout(test2->usefullClass1isA(Class(Test3))); |
---|
| 70 | std::cout << "\n"; |
---|
| 71 | testandcout(test2->usefullClass2isA(Class(Test1))); |
---|
| 72 | testandcout(test2->usefullClass2isA(Class(Test2))); |
---|
| 73 | testandcout(test2->usefullClass2isA(Class(Test3))); |
---|
| 74 | std::cout << "\n"; |
---|
| 75 | testandcout(test2->usefullClass3isA(Class(Test1))); |
---|
| 76 | testandcout(test2->usefullClass3isA(Class(Test2))); |
---|
| 77 | testandcout(test2->usefullClass3isA(Class(Test3))); |
---|
| 78 | } |
---|
| 79 | } |
---|