| 1 | /* | 
|---|
| 2 |    orxonox - the future of 3D-vertical-scrollers | 
|---|
| 3 |  | 
|---|
| 4 |    Copyright (C) 2004 orx | 
|---|
| 5 |  | 
|---|
| 6 |    This program is free software; you can redistribute it and/or modify | 
|---|
| 7 |    it under the terms of the GNU General Public License as published by | 
|---|
| 8 |    the Free Software Foundation; either version 2, or (at your option) | 
|---|
| 9 |    any later version. | 
|---|
| 10 |  | 
|---|
| 11 |    ### File Specific | 
|---|
| 12 |    main-programmer: | 
|---|
| 13 |    co-programmer: | 
|---|
| 14 | */ | 
|---|
| 15 | #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY | 
|---|
| 16 |  | 
|---|
| 17 |  | 
|---|
| 18 | #include "executor/executor.h" | 
|---|
| 19 | #include "util/loading/factory.h" | 
|---|
| 20 | #include "util/loading/load_param.h" | 
|---|
| 21 |  | 
|---|
| 22 |  | 
|---|
| 23 | #include "test_entity.h" | 
|---|
| 24 | #include "debug.h" | 
|---|
| 25 | #include "state.h" | 
|---|
| 26 | #include "shell_command.h" | 
|---|
| 27 | #include "game_world_data.h" | 
|---|
| 28 |  | 
|---|
| 29 | #include "class_id_DEPRECATED.h" | 
|---|
| 30 | ObjectListDefinition(TestEntity); | 
|---|
| 31 | CREATE_FACTORY(TestEntity); | 
|---|
| 32 |  | 
|---|
| 33 |  | 
|---|
| 34 |  | 
|---|
| 35 | /** | 
|---|
| 36 |  * | 
|---|
| 37 |  */ | 
|---|
| 38 | TestEntity::TestEntity () | 
|---|
| 39 | { | 
|---|
| 40 |   this->init(); | 
|---|
| 41 | } | 
|---|
| 42 |  | 
|---|
| 43 |  | 
|---|
| 44 | SHELL_COMMAND(test, TestEntity,test); | 
|---|
| 45 | SHELL_COMMAND(t2, TestEntity,t2); | 
|---|
| 46 | SHELL_COMMAND(t3, TestEntity,t3); | 
|---|
| 47 | SHELL_COMMAND(t4, TestEntity, t4); | 
|---|
| 48 | SHELL_COMMAND(t5, TestEntity,t5); | 
|---|
| 49 |  | 
|---|
| 50 | /** | 
|---|
| 51 |  * | 
|---|
| 52 |  */ | 
|---|
| 53 | TestEntity::TestEntity(const TiXmlElement* root) | 
|---|
| 54 | { | 
|---|
| 55 |   this->init(); | 
|---|
| 56 |  | 
|---|
| 57 |   if( root != NULL) | 
|---|
| 58 |     this->loadParams(root); | 
|---|
| 59 | } | 
|---|
| 60 |  | 
|---|
| 61 |  | 
|---|
| 62 | /** | 
|---|
| 63 |  * | 
|---|
| 64 |  */ | 
|---|
| 65 | TestEntity::~TestEntity () | 
|---|
| 66 | {} | 
|---|
| 67 |  | 
|---|
| 68 |  | 
|---|
| 69 | /** | 
|---|
| 70 |  * | 
|---|
| 71 |  */ | 
|---|
| 72 | void TestEntity::init() | 
|---|
| 73 | { | 
|---|
| 74 |   this->registerObject(this, TestEntity::_objectList); | 
|---|
| 75 |   this->toList(OM_GROUP_00); | 
|---|
| 76 |  | 
|---|
| 77 | } | 
|---|
| 78 |  | 
|---|
| 79 | void TestEntity::test() | 
|---|
| 80 | { | 
|---|
| 81 |   CM= State::getCameraman(); | 
|---|
| 82 |   CM->createCam(); | 
|---|
| 83 |   CM->moveCam(-300, 0, 0, 0); | 
|---|
| 84 | } | 
|---|
| 85 |  | 
|---|
| 86 | void TestEntity::t2() | 
|---|
| 87 | { | 
|---|
| 88 |   CM= State::getCameraman(); | 
|---|
| 89 |   CM->createCam(); | 
|---|
| 90 |   CM->setCam(1); | 
|---|
| 91 |   CM->moveCurrCam(0, 0, 100); | 
|---|
| 92 | } | 
|---|
| 93 |  | 
|---|
| 94 | void TestEntity::t3() | 
|---|
| 95 | { | 
|---|
| 96 |   CM= State::getCameraman(); | 
|---|
| 97 |   CM->moveCurrCam(-300, 0, 0); | 
|---|
| 98 | } | 
|---|
| 99 |  | 
|---|
| 100 | void TestEntity::t4() | 
|---|
| 101 | { | 
|---|
| 102 |   CM= State::getCameraman(); | 
|---|
| 103 |  | 
|---|
| 104 | CM->togglFade(); | 
|---|
| 105 | } | 
|---|
| 106 |  | 
|---|
| 107 | void TestEntity::t5() | 
|---|
| 108 | { | 
|---|
| 109 |   CM= State::getCameraman(); | 
|---|
| 110 |  | 
|---|
| 111 |   CM->setCam(0); | 
|---|
| 112 | } | 
|---|
| 113 |  | 
|---|
| 114 |  | 
|---|
| 115 |  | 
|---|
| 116 | /** | 
|---|
| 117 |  * loads the Settings of a MD2Creature from an XML-element. | 
|---|
| 118 |  * @param root the XML-element to load the MD2Creature's properties from | 
|---|
| 119 |  */ | 
|---|
| 120 | void TestEntity::loadParams(const TiXmlElement* root) | 
|---|
| 121 | { | 
|---|
| 122 |   WorldEntity::loadParams(root); | 
|---|
| 123 | } | 
|---|
| 124 |  | 
|---|
| 125 | void TestEntity::draw() const | 
|---|
| 126 | { | 
|---|
| 127 |  | 
|---|
| 128 | } | 
|---|
| 129 |  | 
|---|
| 130 | /** | 
|---|
| 131 |  * | 
|---|
| 132 |  */ | 
|---|
| 133 | void TestEntity::tick (float time) | 
|---|
| 134 | { | 
|---|
| 135 |  | 
|---|
| 136 | } | 
|---|
| 137 |  | 
|---|
| 138 |  | 
|---|
| 139 | void  TestEntity::changeState (bool sta) | 
|---|
| 140 | { | 
|---|
| 141 |  | 
|---|
| 142 | } | 
|---|