Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/objecthierarchie/src/test1.cc @ 239

Last change on this file since 239 was 218, checked in by landauf, 17 years ago

added factory

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