Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/network/src/orxonox/objects/test3.cc @ 990

Last change on this file since 990 was 871, checked in by landauf, 17 years ago

merged core branch to trunk

File size: 4.4 KB
Line 
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
28#include "test1.h"
29#include "test2.h"
30#include "test3.h"
31#include "core/CoreIncludes.h"
32
33namespace orxonox
34{
35    CreateFactory(Test3);
36
37    Test3::Test3()
38    {
39        RegisterObject(Test3);
40
41        this->setConfigValues();
42    }
43
44    void Test3::setConfigValues()
45    {
46        SetConfigValue(value_int_, 1);
47        SetConfigValue(value_uint_, 1);
48        SetConfigValue(value_char_, 1);
49        SetConfigValue(value_uchar_, 1);
50        SetConfigValue(value_float_, 1);
51        SetConfigValue(value_double_, 1);
52        SetConfigValue(value_bool_, 1);
53        SetConfigValue(value_string_, "This is a test");
54        SetConfigValue(value_constchar_, "This is another test");
55        SetConfigValue(value_vector2_, Vector2(101, 202));
56        SetConfigValue(value_vector3_, Vector3(13, 26, 39));
57        SetConfigValue(value_colourvalue_, ColourValue(1.0, 0.5, 0.25, 0.887));
58    }
59
60    Test3::~Test3()
61    {
62    }
63
64    void Test3::configOutput()
65    {
66        std::cout << "int:         " << this->value_int_ << std::endl;
67        std::cout << "uint:        " << this->value_uint_ << std::endl;
68        std::cout << "char:        " << (int)this->value_char_ << std::endl;
69        std::cout << "uchar:       " << (int)this->value_uchar_ << std::endl;
70        std::cout << "float:       " << this->value_float_ << std::endl;
71        std::cout << "double:      " << this->value_double_ << std::endl;
72        std::cout << "bool:        " << this->value_bool_ << std::endl;
73        std::cout << "string:      " << this->value_string_ << std::endl;
74        std::cout << "constchar:   " << this->value_constchar_ << std::endl;
75        std::cout << "vector2:     " << this->value_vector2_ << std::endl;
76        std::cout << "vector3:     " << this->value_vector3_ << std::endl;
77        std::cout << "colourvalue: " << this->value_colourvalue_ << std::endl;
78    }
79
80    #define testandcout(code) \
81      std::cout << #code << " " << code << std::endl
82
83    void Test3::usefullClassesIsATest(Test1* test1)
84    {
85        std::cout << std::endl;
86        std::cout << "Test1:" << std::endl;
87        testandcout(test1->usefullClass1isA(Class(Test1)));
88        testandcout(test1->usefullClass1isA(Class(Test2)));
89        testandcout(test1->usefullClass1isA(Class(Test3)));
90        std::cout << std::endl;
91        testandcout(test1->usefullClass2isA(Class(Test1)));
92        testandcout(test1->usefullClass2isA(Class(Test2)));
93        testandcout(test1->usefullClass2isA(Class(Test3)));
94        std::cout << std::endl;
95        testandcout(test1->usefullClass3isA(Class(Test1)));
96        testandcout(test1->usefullClass3isA(Class(Test2)));
97        testandcout(test1->usefullClass3isA(Class(Test3)));
98    }
99
100    void Test3::usefullClassesIsATest(Test2* test2)
101    {
102        std::cout << std::endl;
103        std::cout << "Test2:" << std::endl;
104        testandcout(test2->usefullClass1isA(Class(Test1)));
105        testandcout(test2->usefullClass1isA(Class(Test2)));
106        testandcout(test2->usefullClass1isA(Class(Test3)));
107        std::cout << std::endl;
108        testandcout(test2->usefullClass2isA(Class(Test1)));
109        testandcout(test2->usefullClass2isA(Class(Test2)));
110        testandcout(test2->usefullClass2isA(Class(Test3)));
111        std::cout << std::endl;
112        testandcout(test2->usefullClass3isA(Class(Test1)));
113        testandcout(test2->usefullClass3isA(Class(Test2)));
114        testandcout(test2->usefullClass3isA(Class(Test3)));
115    }
116}
Note: See TracBrowser for help on using the repository browser.