Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/merger/src/orxonox/objects/test2.cc @ 318

Last change on this file since 318 was 258, checked in by landauf, 17 years ago

merged object-hierarchy back to trunk

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