Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/main_reto_vs05/src/class_hierarchy/test1.cc @ 232

Last change on this file since 232 was 232, checked in by rgrieder, 17 years ago
  • modified the AmmunitionDump to hold different types of ammo
  • converted the RunManager into a Singleton
  • added some methods to address ammo by string
  • created a BaseWeapon class
  • derived BarrelGun from BaseWeapon
File size: 2.1 KB
Line 
1#include "test1.h"
2#include "test2.h"
3#include "test3.h"
4
5namespace orxonox
6{
7    Test1::Test1()
8    {
9        registerObject(Test1);
10
11        this->usefullClass1_ = Class(Test1);
12        this->usefullClass2_ = Class(Test2);
13        this->usefullClass3_ = Class(Test3);
14    }
15
16    Test1::~Test1()
17    {
18    }
19
20    bool Test1::usefullClass1isA(Identifier* identifier)
21    {
22        return this->usefullClass1_->isA(identifier);
23    }
24
25    bool Test1::usefullClass2isA(Identifier* identifier)
26    {
27        return this->usefullClass2_->isA(identifier);
28    }
29
30    bool Test1::usefullClass3isA(Identifier* identifier)
31    {
32        return this->usefullClass3_.isA(identifier);
33    }
34
35    void Test1::setUsefullClass1(Identifier* identifier)
36    {
37        std::cout << "\n";
38        std::cout << "Test1: usefullClass1->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";
39        std::cout << "Test1: usefullClass1->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";
40        std::cout << "Test1: usefullClass1->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n";
41        this->usefullClass1_ = identifier;
42    }
43
44    void Test1::setUsefullClass2(Identifier* identifier)
45    {
46        std::cout << "\n";
47        std::cout << "Test1: usefullClass2->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";
48        std::cout << "Test1: usefullClass2->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";
49        std::cout << "Test1: usefullClass2->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n";
50        this->usefullClass2_ = identifier;
51    }
52
53    void Test1::setUsefullClassOfTypeTest3(Identifier* identifier)
54    {
55        std::cout << "\n";
56        std::cout << "Test1: usefullClass3->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";
57        std::cout << "Test1: usefullClass3->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";
58        std::cout << "Test1: 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.