Changeset 375 for code/branches
- Timestamp:
- Dec 3, 2007, 10:02:06 PM (17 years ago)
- Location:
- code/branches/objecthierarchy/src
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/CMakeLists.txt
r258 r375 3 3 # create a few variables to simplify life 4 4 SET(SRC_FILES orxonox/orxonox.cc loader/LevelLoader.cc xml/xmlParser.cc orxonox/core/IdentifierList.cc orxonox/core/Identifier.cc orxonox/core/MetaObjectList.cc orxonox/core/Factory.cc orxonox/core/OrxonoxClass.cc orxonox/objects/BaseObject.cc orxonox/objects/test1.cc orxonox/objects/test2.cc orxonox/objects/test3.cc) 5 SET(INC_FILES loader/LevelLoader.h xml/xmlParser.h orxonox/core/IdentifierIncludes.h orxonox/core/Identifier.h orxonox/core/Factory.h orxonox/core/ClassFactory.h orxonox/core/IdentifierList.h orxonox/core/ObjectList.h orxonox/core/MetaObjectList.h orxonox/core/Iterator.h orxonox/core/OrxonoxClass.h orxonox/objects/BaseObject.h orxonox/objects/Test.h orxonox/objects/test1.h orxonox/objects/test2.h orxonox/objects/test3.h )5 SET(INC_FILES loader/LevelLoader.h xml/xmlParser.h orxonox/core/IdentifierIncludes.h orxonox/core/Identifier.h orxonox/core/Factory.h orxonox/core/ClassFactory.h orxonox/core/IdentifierList.h orxonox/core/ObjectList.h orxonox/core/MetaObjectList.h orxonox/core/Iterator.h orxonox/core/OrxonoxClass.h orxonox/objects/BaseObject.h orxonox/objects/Test.h orxonox/objects/test1.h orxonox/objects/test2.h orxonox/objects/test3.h orxonox/objects/Tickable.h orxonox/objects/Timer.h) 6 6 7 7 #Creates an executable -
code/branches/objecthierarchy/src/orxonox/objects/test1.cc
r258 r375 18 18 Test1::~Test1() 19 19 { 20 } 21 22 void Test1::tick(float dt) 23 { 24 std::cout << "Test1: " << this << "\n"; 20 25 } 21 26 -
code/branches/objecthierarchy/src/orxonox/objects/test1.h
r258 r375 3 3 4 4 #include "BaseObject.h" 5 #include "Tickable.h" 5 6 #include "test3.h" 6 7 7 8 namespace orxonox 8 9 { 9 class Test1 : public BaseObject 10 class Test1 : public BaseObject, public Tickable 10 11 { 11 12 public: 12 13 Test1(); 13 14 virtual ~Test1(); 15 16 virtual void tick(float dt); 14 17 15 18 bool usefullClass1isA(Identifier* identifier); -
code/branches/objecthierarchy/src/orxonox/objects/test2.cc
r258 r375 14 14 this->usefullClass2_ = Class(Test2); 15 15 this->usefullClass3_ = Class(Test3); 16 17 timer1.setTimer(1, true, this, &Test2::timerFunction1); 18 timer2.setTimer(5, true, this, &Test2::timerFunction2); 19 timer3.setTimer(10, false, this, &Test2::timerFunction3); 16 20 } 17 21 18 22 Test2::~Test2() 19 23 { 24 } 25 26 void Test2::timerFunction1() 27 { 28 std::cout << "Test2: 1 Sekunde\n"; 29 } 30 31 void Test2::timerFunction2() 32 { 33 std::cout << "Test2: 5 Sekunden\n"; 34 } 35 36 void Test2::timerFunction3() 37 { 38 std::cout << "Test2: 10 Sekunden sind um!\n"; 20 39 } 21 40 -
code/branches/objecthierarchy/src/orxonox/objects/test2.h
r258 r375 3 3 4 4 #include "BaseObject.h" 5 #include "Timer.h" 5 6 6 7 namespace orxonox … … 21 22 void setUsefullClassOfTypeTest3(Identifier* identifier); 22 23 24 void timerFunction1(); 25 void timerFunction2(); 26 void timerFunction3(); 27 23 28 private: 24 29 Identifier* usefullClass1_; … … 26 31 SubclassIdentifier<Test3> usefullClass3_; 27 32 33 Timer<Test2> timer1; 34 Timer<Test2> timer2; 35 Timer<Test2> timer3; 28 36 }; 29 37 } -
code/branches/objecthierarchy/src/orxonox/orxonox.cc
r366 r375 39 39 #include <iostream> 40 40 41 #include "../xml/xmlParser.h"42 #include "../loader/LevelLoader.h"41 //#include "../xml/xmlParser.h" 42 //#include "../loader/LevelLoader.h" 43 43 44 44 #include "core/IdentifierIncludes.h" 45 #include "objects/Tickable.h" 46 #include "objects/Timer.h" 47 45 48 #include "objects/BaseObject.h" 46 49 #include "objects/Test.h" … … 48 51 #include "objects/test2.h" 49 52 #include "objects/test3.h" 50 51 53 52 54 // some tests to see if enet works without includsion … … 106 108 void go() 107 109 { 108 /*109 110 createRoot(); 110 111 defineResources(); … … 117 118 setupCEGUI(); 118 119 createFrameListener(); 119 startRenderLoop(); 120 */ 120 121 121 122 122 #define testandcout(code) \ … … 148 148 test4 = new A3(); 149 149 */ 150 150 /* 151 151 std::cout << "Test 5\n"; 152 152 A1* test5_01 = new A1(); … … 218 218 std::cout << "ID of BaseObject: " << Class(BaseObject)->getNetworkID() << "\n"; 219 219 std::cout << "ID of Test1: " << Class(Test1)->getNetworkID() << "\n"; 220 220 */ 221 221 /* 222 222 std::cout << "\n"; … … 474 474 delete test9_06; 475 475 */ 476 476 /* 477 477 std::cout << "Test 10\n"; 478 478 Identifier* test10_01 = Class(A1B2); … … 605 605 606 606 std::cout << "13\n"; 607 607 */ 608 std::cout << "Test 11\n"; 609 /* 610 std::cout << "1\n"; 611 count = 0; for (Iterator<Tickable> it = ObjectList<Tickable>::start(); it; ++it) { count++; } 612 std::cout << "AnzahlTickable: " << count << "\n"; 613 614 Test1* test11_1; 615 for (int i = 0; i < 3; i++) 616 test11_1 = new Test1; 617 618 count = 0; for (Iterator<Tickable> it = ObjectList<Tickable>::start(); it; ++it) { count++; } 619 std::cout << "AnzahlTickable: " << count << "\n"; 620 621 for (Iterator<Tickable> it = ObjectList<Tickable>::start(); it; ++it) 622 it->tick(0); 623 624 std::cout << "2\n"; 625 */ 626 627 Test2* test11_2 = new Test2; 628 std::cout << "3\n"; 629 630 startRenderLoop(); 608 631 } 609 632 … … 687 710 { 688 711 689 string levelFile = "sp_level_moonstation.oxw";690 loader::LevelLoader* loader = new loader::LevelLoader(levelFile);712 // string levelFile = "sp_level_moonstation.oxw"; 713 // loader::LevelLoader* loader = new loader::LevelLoader(levelFile); 691 714 } 692 715 … … 735 758 void createFrameListener() 736 759 { 760 TickFrameListener* TickFL = new TickFrameListener(); 761 mRoot->addFrameListener(TickFL); 762 763 TimerFrameListener* TimerFL = new TimerFrameListener(); 764 mRoot->addFrameListener(TimerFL); 765 737 766 mListener = new OrxExitListener(mKeyboard); 738 767 mRoot->addFrameListener(mListener);
Note: See TracChangeset
for help on using the changeset viewer.