| [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" | 
|---|
| [742] | 31 | #include "util/tinyxml/tinyxml.h" | 
|---|
| [614] | 32 | #include "../Orxonox.h" | 
|---|
| [482] | 33 | #include <OgreSceneManager.h> | 
|---|
| [197] | 34 |  | 
|---|
 | 35 | namespace orxonox | 
|---|
 | 36 | { | 
|---|
| [218] | 37 |     CreateFactory(Test1); | 
|---|
 | 38 |  | 
|---|
| [197] | 39 |     Test1::Test1() | 
|---|
 | 40 |     { | 
|---|
| [244] | 41 |         RegisterObject(Test1); | 
|---|
| [197] | 42 |  | 
|---|
 | 43 |         this->usefullClass1_ = Class(Test1); | 
|---|
 | 44 |         this->usefullClass2_ = Class(Test2); | 
|---|
 | 45 |         this->usefullClass3_ = Class(Test3); | 
|---|
 | 46 |     } | 
|---|
 | 47 |  | 
|---|
 | 48 |     Test1::~Test1() | 
|---|
 | 49 |     { | 
|---|
 | 50 |     } | 
|---|
 | 51 |  | 
|---|
| [384] | 52 |     void Test1::tick(float dt) | 
|---|
 | 53 |     { | 
|---|
| [677] | 54 |         std::cout << "Test1: " << this << std::endl; | 
|---|
| [384] | 55 |     } | 
|---|
 | 56 |  | 
|---|
| [197] | 57 |     bool Test1::usefullClass1isA(Identifier* identifier) | 
|---|
 | 58 |     { | 
|---|
 | 59 |         return this->usefullClass1_->isA(identifier); | 
|---|
 | 60 |     } | 
|---|
 | 61 |  | 
|---|
 | 62 |     bool Test1::usefullClass2isA(Identifier* identifier) | 
|---|
 | 63 |     { | 
|---|
 | 64 |         return this->usefullClass2_->isA(identifier); | 
|---|
 | 65 |     } | 
|---|
 | 66 |  | 
|---|
 | 67 |     bool Test1::usefullClass3isA(Identifier* identifier) | 
|---|
 | 68 |     { | 
|---|
 | 69 |         return this->usefullClass3_.isA(identifier); | 
|---|
 | 70 |     } | 
|---|
 | 71 |  | 
|---|
 | 72 |     void Test1::setUsefullClass1(Identifier* identifier) | 
|---|
 | 73 |     { | 
|---|
| [677] | 74 |         std::cout << std::endl; | 
|---|
 | 75 |         std::cout << "Test1: usefullClass1->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << std::endl; | 
|---|
 | 76 |         std::cout << "Test1: usefullClass1->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << std::endl; | 
|---|
 | 77 |         std::cout << "Test1: usefullClass1->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << std::endl; | 
|---|
| [197] | 78 |         this->usefullClass1_ = identifier; | 
|---|
 | 79 |     } | 
|---|
 | 80 |  | 
|---|
 | 81 |     void Test1::setUsefullClass2(Identifier* identifier) | 
|---|
 | 82 |     { | 
|---|
| [677] | 83 |         std::cout << std::endl; | 
|---|
 | 84 |         std::cout << "Test1: usefullClass2->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << std::endl; | 
|---|
 | 85 |         std::cout << "Test1: usefullClass2->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << std::endl; | 
|---|
 | 86 |         std::cout << "Test1: usefullClass2->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << std::endl; | 
|---|
| [197] | 87 |         this->usefullClass2_ = identifier; | 
|---|
 | 88 |     } | 
|---|
 | 89 |  | 
|---|
 | 90 |     void Test1::setUsefullClassOfTypeTest3(Identifier* identifier) | 
|---|
 | 91 |     { | 
|---|
| [677] | 92 |         std::cout << std::endl; | 
|---|
 | 93 |         std::cout << "Test1: usefullClass3->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << std::endl; | 
|---|
 | 94 |         std::cout << "Test1: usefullClass3->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << std::endl; | 
|---|
 | 95 |         std::cout << "Test1: usefullClass3->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << std::endl; | 
|---|
| [197] | 96 |         this->usefullClass3_ = identifier; | 
|---|
 | 97 |     } | 
|---|
| [616] | 98 |  | 
|---|
| [480] | 99 |     void Test1::loadParams(TiXmlElement* xmlElem) | 
|---|
 | 100 |     { | 
|---|
| [507] | 101 |  | 
|---|
| [616] | 102 |  | 
|---|
 | 103 |  | 
|---|
| [480] | 104 |     } | 
|---|
| [197] | 105 | } | 
|---|