Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 7, 2008, 5:01:44 PM (17 years ago)
Author:
nicolasc
Message:

merged FICN back into trunk
awaiting release.

Location:
code/trunk
Files:
2 deleted
8 edited
36 copied

Legend:

Unmodified
Added
Removed
  • code/trunk

    • Property svn:ignore set to
      dependencies
  • code/trunk/src/orxonox/objects/Test.h

    r258 r790  
     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
    128#ifndef _Test_H__
    229#define _Test_H__
    330
    4 #include "BaseObject.h"
    5 #include "../core/IdentifierIncludes.h"
     31#include "core/BaseObject.h"
     32#include "../core/CoreIncludes.h"
    633
    734namespace orxonox
  • code/trunk/src/orxonox/objects/test1.cc

    r258 r790  
     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
    128#include "test1.h"
    229#include "test2.h"
    330#include "test3.h"
     31#include "util/tinyxml/tinyxml.h"
     32#include "../Orxonox.h"
     33#include <OgreSceneManager.h>
    434
    535namespace orxonox
     
    1848    Test1::~Test1()
    1949    {
     50    }
     51
     52    void Test1::tick(float dt)
     53    {
     54        std::cout << "Test1: " << this << std::endl;
    2055    }
    2156
     
    3772    void Test1::setUsefullClass1(Identifier* identifier)
    3873    {
    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";
     74        std::cout << std::endl;
     75        std::cout << "Test1: usefullClass1->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << std::endl;
     76        std::cout << "Test1: usefullClass1->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << std::endl;
     77        std::cout << "Test1: usefullClass1->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << std::endl;
    4378        this->usefullClass1_ = identifier;
    4479    }
     
    4681    void Test1::setUsefullClass2(Identifier* identifier)
    4782    {
    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";
     83        std::cout << std::endl;
     84        std::cout << "Test1: usefullClass2->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << std::endl;
     85        std::cout << "Test1: usefullClass2->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << std::endl;
     86        std::cout << "Test1: usefullClass2->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << std::endl;
    5287        this->usefullClass2_ = identifier;
    5388    }
     
    5590    void Test1::setUsefullClassOfTypeTest3(Identifier* identifier)
    5691    {
    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";
     92        std::cout << std::endl;
     93        std::cout << "Test1: usefullClass3->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << std::endl;
     94        std::cout << "Test1: usefullClass3->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << std::endl;
     95        std::cout << "Test1: usefullClass3->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << std::endl;
    6196        this->usefullClass3_ = identifier;
    6297    }
     98
     99    void Test1::loadParams(TiXmlElement* xmlElem)
     100    {
     101
     102
     103
     104    }
    63105}
  • code/trunk/src/orxonox/objects/test1.h

    r258 r790  
    22#define _Test1_H__
    33
    4 #include "BaseObject.h"
     4#include "core/BaseObject.h"
     5#include "Tickable.h"
    56#include "test3.h"
     7#include "util/tinyxml/tinyxml.h"
    68
    79namespace orxonox
    810{
    9     class Test1 : public BaseObject
     11    class Test1 : public BaseObject, public Tickable
    1012    {
    1113        public:
    1214            Test1();
    1315            virtual ~Test1();
     16
     17            virtual void tick(float dt);
    1418
    1519            bool usefullClass1isA(Identifier* identifier);
     
    1923            void setUsefullClass2(Identifier* identifier);
    2024            void setUsefullClassOfTypeTest3(Identifier* identifier);
     25
     26            void loadParams(TiXmlElement* xmlElem);
    2127
    2228        private:
  • code/trunk/src/orxonox/objects/test2.cc

    r258 r790  
     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
    128#include "test1.h"
    229#include "test2.h"
     
    1441        this->usefullClass2_ = Class(Test2);
    1542        this->usefullClass3_ = Class(Test3);
     43
     44        timer1.setTimer(1, true, this, &Test2::timerFunction1);
     45        timer2.setTimer(5, true, this, &Test2::timerFunction2);
     46        timer3.setTimer(10, false, this, &Test2::timerFunction3);
    1647    }
    1748
    1849    Test2::~Test2()
    1950    {
     51    }
     52
     53    void Test2::timerFunction1()
     54    {
     55        std::cout << "Test2: 1 Sekunde" << std::endl;
     56    }
     57
     58    void Test2::timerFunction2()
     59    {
     60        std::cout << "Test2: 5 Sekunden" << std::endl;
     61    }
     62
     63    void Test2::timerFunction3()
     64    {
     65        std::cout << "Test2: 10 Sekunden sind um!" << std::endl;
    2066    }
    2167
     
    3783    void Test2::setUsefullClass1(Identifier* identifier)
    3884    {
    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";
     85        std::cout << std::endl;
     86        std::cout << "Test2: usefullClass1->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << std::endl;
     87        std::cout << "Test2: usefullClass1->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << std::endl;
     88        std::cout << "Test2: usefullClass1->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << std::endl;
    4389        this->usefullClass1_ = identifier;
    4490    }
     
    4692    void Test2::setUsefullClass2(Identifier* identifier)
    4793    {
    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";
     94        std::cout << std::endl;
     95        std::cout << "Test2: usefullClass2->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << std::endl;
     96        std::cout << "Test2: usefullClass2->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << std::endl;
     97        std::cout << "Test2: usefullClass2->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << std::endl;
    5298        this->usefullClass2_ = identifier;
    5399    }
     
    55101    void Test2::setUsefullClassOfTypeTest3(Identifier* identifier)
    56102    {
    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";
     103        std::cout << std::endl;
     104        std::cout << "Test2: usefullClass3->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << std::endl;
     105        std::cout << "Test2: usefullClass3->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << std::endl;
     106        std::cout << "Test2: usefullClass3->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << std::endl;
    61107        this->usefullClass3_ = identifier;
    62108    }
  • code/trunk/src/orxonox/objects/test2.h

    r258 r790  
    22#define _Test2_H__
    33
    4 #include "BaseObject.h"
     4#include "core/BaseObject.h"
     5#include "../tools/Timer.h"
    56
    67namespace orxonox
     
    2122            void setUsefullClassOfTypeTest3(Identifier* identifier);
    2223
     24            void timerFunction1();
     25            void timerFunction2();
     26            void timerFunction3();
     27
    2328        private:
    2429            Identifier* usefullClass1_;
     
    2631            SubclassIdentifier<Test3> usefullClass3_;
    2732
     33            Timer<Test2> timer1;
     34            Timer<Test2> timer2;
     35            Timer<Test2> timer3;
    2836    };
    2937}
  • code/trunk/src/orxonox/objects/test3.cc

    r258 r790  
     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
    128#include "test1.h"
    229#include "test2.h"
     
    1037    {
    1138        RegisterObject(Test3);
     39
     40        this->setConfigValues();
     41    }
     42
     43    void Test3::setConfigValues()
     44    {
     45        SetConfigValue(value_int_, 1);
     46        SetConfigValue(value_uint_, 1);
     47        SetConfigValue(value_char_, 1);
     48        SetConfigValue(value_uchar_, 1);
     49        SetConfigValue(value_float_, 1);
     50        SetConfigValue(value_double_, 1);
     51        SetConfigValue(value_bool_, 1);
     52        SetConfigValue(value_string_, "This is a test");
     53        SetConfigValue(value_constchar_, "This is another test");
     54        SetConfigValue(value_vector2_, Vector2(101, 202));
     55        SetConfigValue(value_vector3_, Vector3(13, 26, 39));
     56        SetConfigValue(value_colourvalue_, ColourValue(1.0, 0.5, 0.25, 0.887));
    1257    }
    1358
     
    1560    {
    1661    }
    17         #define testandcout(code) \
    18           std::cout << #code << " " << code << "\n"
    1962
    20     bool Test3::usefullClassesIsATest(Test1* test1)
     63    void Test3::configOutput()
    2164    {
    22         std::cout << "\n";
    23         std::cout << "Test1:\n";
     65        std::cout << this->value_int_ << std::endl;
     66        std::cout << this->value_uint_ << std::endl;
     67        std::cout << (int)this->value_char_ << std::endl;
     68        std::cout << (int)this->value_uchar_ << std::endl;
     69        std::cout << this->value_float_ << std::endl;
     70        std::cout << this->value_double_ << std::endl;
     71        std::cout << this->value_bool_ << std::endl;
     72        std::cout << this->value_string_ << std::endl;
     73        std::cout << this->value_constchar_ << std::endl;
     74        std::cout << this->value_vector2_ << std::endl;
     75        std::cout << this->value_vector3_ << std::endl;
     76        std::cout << this->value_colourvalue_ << std::endl;
     77    }
     78
     79    #define testandcout(code) \
     80      std::cout << #code << " " << code << std::endl
     81
     82    void Test3::usefullClassesIsATest(Test1* test1)
     83    {
     84        std::cout << std::endl;
     85        std::cout << "Test1:" << std::endl;
    2486        testandcout(test1->usefullClass1isA(Class(Test1)));
    2587        testandcout(test1->usefullClass1isA(Class(Test2)));
    2688        testandcout(test1->usefullClass1isA(Class(Test3)));
    27         std::cout << "\n";
     89        std::cout << std::endl;
    2890        testandcout(test1->usefullClass2isA(Class(Test1)));
    2991        testandcout(test1->usefullClass2isA(Class(Test2)));
    3092        testandcout(test1->usefullClass2isA(Class(Test3)));
    31         std::cout << "\n";
     93        std::cout << std::endl;
    3294        testandcout(test1->usefullClass3isA(Class(Test1)));
    3395        testandcout(test1->usefullClass3isA(Class(Test2)));
     
    3597    }
    3698
    37     bool Test3::usefullClassesIsATest(Test2* test2)
     99    void Test3::usefullClassesIsATest(Test2* test2)
    38100    {
    39         std::cout << "\n";
    40         std::cout << "Test2:\n";
     101        std::cout << std::endl;
     102        std::cout << "Test2:" << std::endl;
    41103        testandcout(test2->usefullClass1isA(Class(Test1)));
    42104        testandcout(test2->usefullClass1isA(Class(Test2)));
    43105        testandcout(test2->usefullClass1isA(Class(Test3)));
    44         std::cout << "\n";
     106        std::cout << std::endl;
    45107        testandcout(test2->usefullClass2isA(Class(Test1)));
    46108        testandcout(test2->usefullClass2isA(Class(Test2)));
    47109        testandcout(test2->usefullClass2isA(Class(Test3)));
    48         std::cout << "\n";
     110        std::cout << std::endl;
    49111        testandcout(test2->usefullClass3isA(Class(Test1)));
    50112        testandcout(test2->usefullClass3isA(Class(Test2)));
  • code/trunk/src/orxonox/objects/test3.h

    r258 r790  
    22#define _Test3_H__
    33
    4 #include "BaseObject.h"
     4#include "core/BaseObject.h"
    55
    66namespace orxonox
     
    1515            virtual ~Test3();
    1616
    17             bool usefullClassesIsATest(Test1* test1);
    18             bool usefullClassesIsATest(Test2* test2);
     17            void setConfigValues();
     18
     19            void usefullClassesIsATest(Test1* test1);
     20            void usefullClassesIsATest(Test2* test2);
     21
     22            void configOutput();
     23
     24        private:
     25            int                 value_int_;
     26            unsigned int        value_uint_;
     27            char                value_char_;
     28            unsigned char       value_uchar_;
     29            float               value_float_;
     30            double              value_double_;
     31            bool                value_bool_;
     32            std::string         value_string_;
     33            const char*         value_constchar_;
     34            Vector2             value_vector2_;
     35            Vector3             value_vector3_;
     36            ColourValue         value_colourvalue_;
    1937    };
    2038}
Note: See TracChangeset for help on using the changeset viewer.