| [670] | 1 | /* | 
|---|
 | 2 |  *   ORXONOX - the hottest 3D action shooter ever to exist | 
|---|
 | 3 |  * | 
|---|
 | 4 |  * | 
|---|
 | 5 |  *   License notice: | 
|---|
 | 6 |  * | 
|---|
 | 7 |  *   This program is free software; you can redistribute it and/or | 
|---|
 | 8 |  *   modify it under the terms of the GNU General Public License | 
|---|
 | 9 |  *   as published by the Free Software Foundation; either version 2 | 
|---|
 | 10 |  *   of the License, or (at your option) any later version. | 
|---|
 | 11 |  * | 
|---|
 | 12 |  *   This program is distributed in the hope that it will be useful, | 
|---|
 | 13 |  *   but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
 | 14 |  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|---|
 | 15 |  *   GNU General Public License for more details. | 
|---|
 | 16 |  * | 
|---|
 | 17 |  *   You should have received a copy of the GNU General Public License | 
|---|
 | 18 |  *   along with this program; if not, write to the Free Software | 
|---|
 | 19 |  *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA. | 
|---|
 | 20 |  * | 
|---|
 | 21 |  *   Author: | 
|---|
 | 22 |  *      Fabian 'x3n' Landau | 
|---|
 | 23 |  *   Co-authors: | 
|---|
 | 24 |  *      ... | 
|---|
 | 25 |  * | 
|---|
 | 26 |  */ | 
|---|
 | 27 |  | 
|---|
| [197] | 28 | #include "test1.h" | 
|---|
 | 29 | #include "test2.h" | 
|---|
 | 30 | #include "test3.h" | 
|---|
 | 31 |  | 
|---|
 | 32 | namespace orxonox | 
|---|
 | 33 | { | 
|---|
| [218] | 34 |     CreateFactory(Test2); | 
|---|
 | 35 |  | 
|---|
| [197] | 36 |     Test2::Test2() | 
|---|
 | 37 |     { | 
|---|
| [244] | 38 |         RegisterObject(Test2); | 
|---|
| [197] | 39 |  | 
|---|
 | 40 |         this->usefullClass1_ = Class(Test1); | 
|---|
 | 41 |         this->usefullClass2_ = Class(Test2); | 
|---|
 | 42 |         this->usefullClass3_ = Class(Test3); | 
|---|
| [384] | 43 |  | 
|---|
 | 44 |         timer1.setTimer(1, true, this, &Test2::timerFunction1); | 
|---|
 | 45 |         timer2.setTimer(5, true, this, &Test2::timerFunction2); | 
|---|
 | 46 |         timer3.setTimer(10, false, this, &Test2::timerFunction3); | 
|---|
| [197] | 47 |     } | 
|---|
 | 48 |  | 
|---|
 | 49 |     Test2::~Test2() | 
|---|
 | 50 |     { | 
|---|
 | 51 |     } | 
|---|
 | 52 |  | 
|---|
| [384] | 53 |     void Test2::timerFunction1() | 
|---|
 | 54 |     { | 
|---|
| [677] | 55 |         std::cout << "Test2: 1 Sekunde" << std::endl; | 
|---|
| [384] | 56 |     } | 
|---|
 | 57 |  | 
|---|
 | 58 |     void Test2::timerFunction2() | 
|---|
 | 59 |     { | 
|---|
| [677] | 60 |         std::cout << "Test2: 5 Sekunden" << std::endl; | 
|---|
| [384] | 61 |     } | 
|---|
 | 62 |  | 
|---|
 | 63 |     void Test2::timerFunction3() | 
|---|
 | 64 |     { | 
|---|
| [677] | 65 |         std::cout << "Test2: 10 Sekunden sind um!" << std::endl; | 
|---|
| [384] | 66 |     } | 
|---|
 | 67 |  | 
|---|
| [197] | 68 |     bool Test2::usefullClass1isA(Identifier* identifier) | 
|---|
 | 69 |     { | 
|---|
 | 70 |         return this->usefullClass1_->isA(identifier); | 
|---|
 | 71 |     } | 
|---|
 | 72 |  | 
|---|
 | 73 |     bool Test2::usefullClass2isA(Identifier* identifier) | 
|---|
 | 74 |     { | 
|---|
 | 75 |         return this->usefullClass2_->isA(identifier); | 
|---|
 | 76 |     } | 
|---|
 | 77 |  | 
|---|
 | 78 |     bool Test2::usefullClass3isA(Identifier* identifier) | 
|---|
 | 79 |     { | 
|---|
 | 80 |         return this->usefullClass3_.isA(identifier); | 
|---|
 | 81 |     } | 
|---|
 | 82 |  | 
|---|
 | 83 |     void Test2::setUsefullClass1(Identifier* identifier) | 
|---|
 | 84 |     { | 
|---|
| [677] | 85 |         std::cout << std::endl; | 
|---|
 | 86 |         std::cout << "Test2: usefullClass1->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << std::endl; | 
|---|
 | 87 |         std::cout << "Test2: usefullClass1->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << std::endl; | 
|---|
 | 88 |         std::cout << "Test2: usefullClass1->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << std::endl; | 
|---|
| [197] | 89 |         this->usefullClass1_ = identifier; | 
|---|
 | 90 |     } | 
|---|
 | 91 |  | 
|---|
 | 92 |     void Test2::setUsefullClass2(Identifier* identifier) | 
|---|
 | 93 |     { | 
|---|
| [677] | 94 |         std::cout << std::endl; | 
|---|
 | 95 |         std::cout << "Test2: usefullClass2->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << std::endl; | 
|---|
 | 96 |         std::cout << "Test2: usefullClass2->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << std::endl; | 
|---|
 | 97 |         std::cout << "Test2: usefullClass2->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << std::endl; | 
|---|
| [197] | 98 |         this->usefullClass2_ = identifier; | 
|---|
 | 99 |     } | 
|---|
 | 100 |  | 
|---|
 | 101 |     void Test2::setUsefullClassOfTypeTest3(Identifier* identifier) | 
|---|
 | 102 |     { | 
|---|
| [677] | 103 |         std::cout << std::endl; | 
|---|
 | 104 |         std::cout << "Test2: usefullClass3->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << std::endl; | 
|---|
 | 105 |         std::cout << "Test2: usefullClass3->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << std::endl; | 
|---|
 | 106 |         std::cout << "Test2: usefullClass3->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << std::endl; | 
|---|
| [197] | 107 |         this->usefullClass3_ = identifier; | 
|---|
 | 108 |     } | 
|---|
 | 109 | } | 
|---|