| 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: Patrick Boenzli patrick@orxonox.net | 
|---|
| 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 "mount_point.h" | 
|---|
| 24 | #include "debug.h" | 
|---|
| 25 | #include "state.h" | 
|---|
| 26 |  | 
|---|
| 27 |  | 
|---|
| 28 | ObjectListDefinition(MountPoint); | 
|---|
| 29 | CREATE_FACTORY(MountPoint); | 
|---|
| 30 |  | 
|---|
| 31 |  | 
|---|
| 32 | /** | 
|---|
| 33 |  * construct | 
|---|
| 34 |  */ | 
|---|
| 35 | MountPoint::MountPoint () | 
|---|
| 36 | { | 
|---|
| 37 |   this->init(); | 
|---|
| 38 | } | 
|---|
| 39 |  | 
|---|
| 40 |  | 
|---|
| 41 | /** | 
|---|
| 42 |  * constructor | 
|---|
| 43 |  * @param root the xml root element | 
|---|
| 44 |  */ | 
|---|
| 45 | MountPoint::MountPoint(const TiXmlElement* root) | 
|---|
| 46 | { | 
|---|
| 47 |   this->init(); | 
|---|
| 48 |  | 
|---|
| 49 |   if( root != NULL) | 
|---|
| 50 |     this->loadParams(root); | 
|---|
| 51 | } | 
|---|
| 52 |  | 
|---|
| 53 |  | 
|---|
| 54 | /** | 
|---|
| 55 |  * deconstructor | 
|---|
| 56 |  */ | 
|---|
| 57 | MountPoint::~MountPoint () | 
|---|
| 58 | {} | 
|---|
| 59 |  | 
|---|
| 60 |  | 
|---|
| 61 | /** | 
|---|
| 62 |  * initializing function | 
|---|
| 63 |  */ | 
|---|
| 64 | void MountPoint::init() | 
|---|
| 65 | { | 
|---|
| 66 |   this->registerObject(this, MountPoint::_objectList); | 
|---|
| 67 |   this->toList(OM_GROUP_00); | 
|---|
| 68 |  | 
|---|
| 69 |   this->_mount = NULL; | 
|---|
| 70 | } | 
|---|
| 71 |  | 
|---|
| 72 |  | 
|---|
| 73 | /** | 
|---|
| 74 |  * loads the Settings of a MD2Creature from an XML-element. | 
|---|
| 75 |  * @param root the XML-element to load the MD2Creature's properties from | 
|---|
| 76 |  */ | 
|---|
| 77 | void MountPoint::loadParams(const TiXmlElement* root) | 
|---|
| 78 | { | 
|---|
| 79 |   WorldEntity::loadParams(root); | 
|---|
| 80 | } | 
|---|
| 81 |  | 
|---|
| 82 |  | 
|---|
| 83 |  | 
|---|
| 84 | /** | 
|---|
| 85 |  * tick | 
|---|
| 86 |  * @param time  time passed since the last tick | 
|---|
| 87 |  */ | 
|---|
| 88 | void MountPoint::tick (float time) | 
|---|
| 89 | { | 
|---|
| 90 |  | 
|---|
| 91 |  | 
|---|
| 92 | } | 
|---|
| 93 |  | 
|---|
| 94 |  | 
|---|
| 95 | /** | 
|---|
| 96 |  * draw this entity | 
|---|
| 97 |  */ | 
|---|
| 98 | void MountPoint::draw() const | 
|---|
| 99 | { | 
|---|
| 100 |  | 
|---|
| 101 | } | 
|---|
| 102 |  | 
|---|
| 103 |  | 
|---|
| 104 |  | 
|---|
| 105 | /** | 
|---|
| 106 |  *  function called to draw the mount point itself for debug purposes only | 
|---|
| 107 |  */ | 
|---|
| 108 | void MountPoint::debugDraw() const | 
|---|
| 109 | { | 
|---|
| 110 |  | 
|---|
| 111 | } | 
|---|
| 112 |  | 
|---|
| 113 |  | 
|---|
| 114 | /** | 
|---|
| 115 |  * adds an entity to this mount point | 
|---|
| 116 |  * @param entity entity to be added | 
|---|
| 117 |  */ | 
|---|
| 118 | void MountPoint::mount(WorldEntity* entity) | 
|---|
| 119 | { | 
|---|
| 120 |   this->_mount = entity; | 
|---|
| 121 | } | 
|---|
| 122 |  | 
|---|
| 123 |  | 
|---|
| 124 | /** | 
|---|
| 125 |  * removes an entity from this mount point | 
|---|
| 126 |  */ | 
|---|
| 127 | void MountPoint::unmount() | 
|---|
| 128 | { | 
|---|
| 129 |   this->_mount = NULL; | 
|---|
| 130 | } | 
|---|
| 131 |  | 
|---|