Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 318 was 300, checked in by nicolasc, 17 years ago

initial merge of main_reto

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