Changeset 8767 for code/trunk/src/modules
- Timestamp:
- Jul 20, 2011, 11:27:45 PM (13 years ago)
- Location:
- code/trunk/src/modules
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/gametypes/RaceCheckPoint.cc
r8706 r8767 31 31 #include "core/CoreIncludes.h" 32 32 #include "core/XMLPort.h" 33 #include "util/Convert.h" 34 33 35 #include "SpaceRace.h" 34 #include "util/Convert.h"35 36 36 37 namespace orxonox 37 38 { 38 39 CreateFactory(RaceCheckPoint); 39 40 40 41 RaceCheckPoint::RaceCheckPoint(BaseObject* creator): DistanceTrigger(creator), RadarViewable(creator, static_cast<WorldEntity*>(this)) 41 42 { … … 50 51 this->setRadarVisibility(false); 51 52 } 52 53 53 54 RaceCheckPoint::~RaceCheckPoint() 54 55 { 55 56 } 56 57 57 58 void RaceCheckPoint::tick(float dt) 58 59 { … … 60 61 61 62 SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get()); 63 assert(gametype); 62 64 if (this->getCheckpointIndex() == gametype->getCheckpointsReached()) 63 65 this->setRadarVisibility(true); … … 66 68 } 67 69 68 69 70 void RaceCheckPoint::XMLPort(Element& xmlelement, XMLPort::Mode mode) 70 71 { … … 75 76 XMLPortParam(RaceCheckPoint, "timelimit", setTimelimit, getTimeLimit, xmlelement, mode).defaultValues(0); 76 77 } 77 78 78 79 void RaceCheckPoint::triggered(bool bIsTriggered) 79 80 { … … 99 100 } 100 101 } 101 102 102 103 void RaceCheckPoint::setTimelimit(float timeLimit) 103 104 { … … 115 116 } 116 117 } 117 118 118 119 } -
code/trunk/src/modules/gametypes/RaceCheckPoint.h
r8706 r8767 34 34 #include "objects/triggers/DistanceTrigger.h" 35 35 #include "interfaces/RadarViewable.h" 36 //#include <boost/concept_check.hpp>37 36 38 37 namespace orxonox 39 38 { 40 /**41 @brief42 The RaceCheckPoint class enables the creation of a check point to use in a SpaceRace level.43 !!! Don't forget to control the indexes of your check points and to set one last check point!!!44 */39 /** 40 @brief 41 The RaceCheckPoint class enables the creation of a check point to use in a SpaceRace level. 42 !!! Don't forget to control the indexes of your check points and to set one last check point!!! 43 */ 45 44 class _GametypesExport RaceCheckPoint : public DistanceTrigger, public RadarViewable 46 45 { -
code/trunk/src/modules/gametypes/SpaceRace.cc
r8706 r8767 31 31 #include "core/CoreIncludes.h" 32 32 #include "network/Host.h" 33 #include <util/Clock.h>34 #include <util/Math.h>35 33 #include "util/Convert.h" 34 #include "util/Math.h" 36 35 37 36 namespace orxonox 38 37 { 39 38 CreateUnloadableFactory(SpaceRace); 40 39 41 40 SpaceRace::SpaceRace(BaseObject* creator) : Gametype(creator) 42 41 { 43 42 RegisterObject(SpaceRace); 44 this-> bCheckpointsReached_ = 0;43 this->checkpointsReached_ = 0; 45 44 this->bTimeIsUp_ = false; 46 45 this->numberOfBots_ = 0; 47 46 } 48 47 49 48 void SpaceRace::end() 50 49 { 51 50 this->Gametype::end(); 52 51 53 52 if (this->bTimeIsUp_) 54 53 { … … 57 56 int ms = this->clock_.getMilliseconds()-1000*s; 58 57 const std::string& message = multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) + " seconds !!\n" 59 + "You didn't reach the check point " + multi_cast<std::string>(this-> bCheckpointsReached_+1)58 + "You didn't reach the check point " + multi_cast<std::string>(this->checkpointsReached_+1) 60 59 + " before the time limit. You lose!"; 61 60 COUT(3) << message; 62 61 const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message); 63 Host::Broadcast(message);64 62 } 65 63 else … … 72 70 COUT(3) << message << std::endl; 73 71 const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message); 74 Host::Broadcast(message);75 72 float time = this->clock_.getSecondsPrecise(); 76 73 this->scores_.insert(time); … … 87 84 std::string message("The match has started! Reach the check points as quickly as possible!"); 88 85 COUT(3) << message << std::endl; 89 Host::Broadcast(message);86 const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message); 90 87 } 91 88 92 89 void SpaceRace::newCheckpointReached() 93 90 { 94 this-> bCheckpointsReached_++;91 this->checkpointsReached_++; 95 92 this->clock_.capture(); 96 93 int s = this->clock_.getSeconds(); … … 101 98 COUT(3) << message; 102 99 const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message); 103 Host::Broadcast(message);104 100 } 105 101 -
code/trunk/src/modules/gametypes/SpaceRace.h
r8706 r8767 30 30 #define _SpaceRace_H__ 31 31 32 #include "gametypes/GametypesPrereqs.h" 33 34 #include <set> 35 #include <string> 36 37 #include <util/Clock.h> 38 32 39 #include "gametypes/Gametype.h" 33 #include "gametypes/GametypesPrereqs.h" 40 34 41 #include "RaceCheckPoint.h" 35 #include <boost/concept_check.hpp>36 #include <util/Clock.h>37 #include <string.h>38 #include <set>39 42 40 43 namespace orxonox … … 47 50 { 48 51 friend class RaceCheckPoint; 49 52 50 53 public: 51 54 SpaceRace(BaseObject* creator); … … 53 56 54 57 virtual void start(); 55 58 virtual void end(); 56 59 57 60 virtual void newCheckpointReached(); 58 61 59 62 inline void setCheckpointsReached(int n) 60 { this->bCheckpointsReached_ = n;}63 { this->checkpointsReached_ = n;} 61 64 inline int getCheckpointsReached() 62 { return this->bCheckpointsReached_; }65 { return this->checkpointsReached_; } 63 66 inline void timeIsUp() 64 { this->bTimeIsUp_ = true;}67 { this->bTimeIsUp_ = true;} 65 68 66 69 protected: 67 70 68 71 private: 69 int bCheckpointsReached_; //The current number of check points reached by the player.72 int checkpointsReached_; //The current number of check points reached by the player. 70 73 std::set<float> scores_; //The times of the players are saved in a set. 71 74 bool bTimeIsUp_; //True if one of the check points is reached too late. -
code/trunk/src/modules/objects/SpaceBoundaries.cc
r8706 r8767 58 58 { 59 59 this->pawnsIn_.clear(); 60 60 61 61 for( std::vector<BillboardAdministration>::iterator current = this->billboards_.begin(); current != this->billboards_.end(); current++) 62 62 { … … 69 69 } 70 70 } 71 71 72 72 void SpaceBoundaries::checkWhoIsIn() 73 73 { … … 94 94 } 95 95 } 96 96 97 97 void SpaceBoundaries::positionBillboard(const Vector3& position, float alpha) 98 98 { … … 124 124 this->billboards_[current].billy->setCommonUpVector(upVector); 125 125 } 126 126 127 127 void SpaceBoundaries::setBillboardOptions(Billboard *billy) 128 128 { … … 135 135 } 136 136 } 137 137 138 138 void SpaceBoundaries::removeAllBillboards() 139 139 { … … 144 144 } 145 145 } 146 146 147 147 void SpaceBoundaries::setMaxDistance(float r) 148 148 { … … 153 153 return this->maxDistance_; 154 154 } 155 155 156 156 void SpaceBoundaries::setWarnDistance(float r) 157 157 { … … 162 162 return this->warnDistance_; 163 163 } 164 164 165 165 void SpaceBoundaries::setShowDistance(float r) 166 166 { … … 171 171 return this->showDistance_; 172 172 } 173 173 174 174 void SpaceBoundaries::setHealthDecrease(float amount) 175 175 { … … 180 180 return this->healthDecrease_; 181 181 } 182 182 183 183 void SpaceBoundaries::setReaction(int mode) 184 184 { … … 200 200 XMLPortParam(SpaceBoundaries, "reactionMode", setReaction, getReaction, xmlelement, mode); 201 201 } 202 202 203 203 void SpaceBoundaries::tick(float dt) 204 204 { 205 205 this->checkWhoIsIn(); 206 206 this->removeAllBillboards(); 207 207 208 208 float distance; 209 209 bool humanItem; … … 247 247 } 248 248 } 249 249 250 250 float SpaceBoundaries::computeDistance(WorldEntity *item) 251 251 { … … 258 258 } 259 259 } 260 260 261 261 void SpaceBoundaries::displayWarning(const std::string warnText) 262 { 262 { 263 263 // TODO 264 264 } 265 265 266 266 void SpaceBoundaries::displayBoundaries(Pawn *item, float alpha) 267 267 { 268 268 269 269 Vector3 direction = item->getPosition() - this->getPosition(); 270 270 direction.normalise(); 271 271 272 272 Vector3 boundaryPosition = this->getPosition() + direction * this->maxDistance_; 273 273 274 274 this->positionBillboard(boundaryPosition, alpha); 275 275 } 276 276 277 277 void SpaceBoundaries::conditionalBounceBack(Pawn *item, float currentDistance, float dt) 278 278 { … … 281 281 Vector3 velocity = item->getVelocity(); 282 282 float normalSpeed = item->getVelocity().dotProduct(normal); 283 283 284 284 /* Check, whether the Pawn would leave the boundary in the next tick, if so send it back. */ 285 285 if( this->reaction_ == 0 && currentDistance + normalSpeed * dt > this->maxDistance_ - 10 ) // -10: "security measure" … … 292 292 } 293 293 } 294 294 295 295 void SpaceBoundaries::bounceBack(Pawn *item, Vector3 *normal, Vector3 *velocity) 296 296 { … … 299 299 Vector3 acceleration = item->getAcceleration(); 300 300 acceleration = acceleration.reflect(*normal); 301 301 302 302 item->lookAt( *velocity + this->getPosition() ); 303 303 304 304 item->setAcceleration(acceleration * dampingFactor); 305 305 item->setVelocity(*velocity * dampingFactor); 306 306 307 307 item->setPosition( item->getPosition() - *normal * 10 ); // Set the position of the Pawn to be well inside the boundary. 308 308 } 309 309 310 310 bool SpaceBoundaries::isHumanPlayer(Pawn *item) 311 311 { … … 319 319 return false; 320 320 } 321 321 322 322 } -
code/trunk/src/modules/objects/SpaceBoundaries.h
r8706 r8767 45 45 { 46 46 47 /**48 @brief SpaceBoundaries gives level creators the possibility to bar Pawns from leaving a defined area (until now this area is a ball).47 /** 48 @brief SpaceBoundaries gives level creators the possibility to bar Pawns from leaving a defined area (until now this area is a ball). 49 49 50 Some attributes can/should be defined in the XML-File:51 - 'position' : absolute position of the object of SpaceBoundaries in the level (usually 0,0,0)52 - 'maxDistance' : defines the area, where a pawn is allowed to be (radius of a ball).53 - 'warnDistance' : If the distance between the pawn of the human player and 'position' is bigger than 'warnDistance', a message is displayed to54 inform the player that he'll soon be leaving the allowed area. (not implemented yet!)55 - 'showDistance' : If the distance between the pawn and the boundary of the allowed area is smaller than 'showDistance', the boundary is shown.56 - 'reactionMode' : Integer-Value. Defines what effect appears if a space ship has crossed the boundaries.57 0: Reflect the space ship (default).58 1: Decrease Health of the space ship after having left the allowed area.59 2: Inverted Version of 0. Prohibit to fly INTO a defined area.60 - 'healthDecrease' : a measure to define how fast the health of a pawn should decrease after leaving the allowed area (unnecessary if 'reactionMode' == 0).61 Recommended values: 0.1 (slow health decrease) to 5 (very fast health decrease)50 Some attributes can/should be defined in the XML-File: 51 - 'position' : absolute position of the object of SpaceBoundaries in the level (usually 0,0,0) 52 - 'maxDistance' : defines the area, where a pawn is allowed to be (radius of a ball). 53 - 'warnDistance' : If the distance between the pawn of the human player and 'position' is bigger than 'warnDistance', a message is displayed to 54 inform the player that he'll soon be leaving the allowed area. (not implemented yet!) 55 - 'showDistance' : If the distance between the pawn and the boundary of the allowed area is smaller than 'showDistance', the boundary is shown. 56 - 'reactionMode' : Integer-Value. Defines what effect appears if a space ship has crossed the boundaries. 57 0: Reflect the space ship (default). 58 1: Decrease Health of the space ship after having left the allowed area. 59 2: Inverted Version of 0. Prohibit to fly INTO a defined area. 60 - 'healthDecrease' : a measure to define how fast the health of a pawn should decrease after leaving the allowed area (unnecessary if 'reactionMode' == 0). 61 Recommended values: 0.1 (slow health decrease) to 5 (very fast health decrease) 62 62 63 Follow http://www.orxonox.net/wiki/SpaceBoundaries to get some further information.63 Follow http://www.orxonox.net/wiki/SpaceBoundaries to get some further information. 64 64 65 Examples:66 Two examples how one could include SpaceBoundaries in the XML-File. The first one uses reflection, the second one health decrease.67 @code68 <SpaceBoundaries position="0,0,0" maxDistance="1000" warnDistance="800" showDistance="100" reactionMode="0" />69 @endcode65 Examples: 66 Two examples how one could include SpaceBoundaries in the XML-File. The first one uses reflection, the second one health decrease. 67 @code 68 <SpaceBoundaries position="0,0,0" maxDistance="1000" warnDistance="800" showDistance="100" reactionMode="0" /> 69 @endcode 70 70 71 @code 72 <SpaceBoundaries position="0,0,0" maxDistance="1000" warnDistance="800" showDistance="100" reactionMode="1" healthDecrease="0.2" /> 73 @endcode 74 */ 75 71 @code 72 <SpaceBoundaries position="0,0,0" maxDistance="1000" warnDistance="800" showDistance="100" reactionMode="1" healthDecrease="0.2" /> 73 @endcode 74 */ 76 75 class _ObjectsExport SpaceBoundaries : public StaticEntity, public Tickable 77 76 { … … 79 78 SpaceBoundaries(BaseObject* creator); 80 79 ~SpaceBoundaries(); 81 80 82 81 void setMaxDistance(float r); 83 82 float getMaxDistance(); 84 83 85 84 void setWarnDistance(float r); 86 85 float getWarnDistance(); 87 86 88 87 void setShowDistance(float r); 89 88 float getShowDistance(); 90 89 91 90 void setHealthDecrease(float amount); 92 91 float getHealthDecrease(); 93 92 94 93 void setReaction(int mode); 95 94 int getReaction(); 96 95 97 96 void XMLPort(Element& xmlelement, XMLPort::Mode mode); 98 97 99 98 void tick(float dt); 100 99 101 100 private: 102 101 struct BillboardAdministration{ bool usedYet; Billboard* billy; }; 103 102 104 103 // Variabeln:: 105 104 std::list<WeakPtr<Pawn> > pawnsIn_; //!< List of the pawns that this instance of SpaceBoundaries has to handle. 106 105 107 106 std::vector<BillboardAdministration> billboards_; 108 107 109 108 int reaction_; //!< Values: 0, 1, 2. 110 109 //!< 0: Reflection on boundary (Standard). … … 114 113 float warnDistance_; //!< Distance in which a warning is displayed. 115 114 float showDistance_; //!< Distance at which the boundaries are displayed. 116 115 117 116 float healthDecrease_; //!< Rate of health loss. 118 117 119 118 //RadarViewable* centerRadar_; //!< Representation of the space boundary in the radar. 120 119 121 120 // Funktionen:: 122 121 float computeDistance(WorldEntity *item); //!< Compute distance to center point. … … 126 125 void bounceBack(Pawn *item, Vector3 *normal, Vector3 *velocity); 127 126 bool isHumanPlayer(Pawn *item); 128 127 129 128 void checkWhoIsIn(); //!< Update the list 'pawnsIn_'. 130 129 131 130 void positionBillboard(const Vector3& position, float alpha); //!< Display a Billboard at the position 'position'. 132 131 void setBillboardOptions(Billboard *billy); 133 132 void removeAllBillboards(); //!< Hide all elements of '*billboard_' and set their attribute 'usedYet' to 0. 134 135 133 }; 136 134 } -
code/trunk/src/modules/portals/PortalEndPoint.cc
r8706 r8767 28 28 29 29 #include "PortalEndPoint.h" 30 31 #include <ctime> 32 33 #include "core/CoreIncludes.h" 30 34 #include "core/XMLPort.h" 35 36 #include "worldentities/MobileEntity.h" 37 31 38 #include "objects/triggers/MultiTriggerContainer.h" 39 32 40 #include "portals/PortalLink.h" 33 #include "worldentities/MobileEntity.h"34 #include <ctime>35 41 36 42 namespace orxonox 37 43 { 38 44 CreateFactory(PortalEndPoint); 39 45 40 46 /*static*/ const std::string PortalEndPoint::EVENTFUNCTIONNAME = "execute"; 41 47 … … 45 51 { 46 52 RegisterObject(PortalEndPoint); 47 53 48 54 this->trigger_ = new DistanceMultiTrigger(this); 49 55 this->trigger_->setName("portal"); 50 this->attach(t rigger_);56 this->attach(this->trigger_); 51 57 52 58 this->setRadarObjectColour(ColourValue::White); … … 54 60 this->setRadarVisibility(true); 55 61 } 56 62 57 63 PortalEndPoint::~PortalEndPoint() 58 64 { … … 64 70 { 65 71 SUPER(PortalEndPoint, XMLPort, xmlelement, mode); 66 72 67 73 XMLPortParam(PortalEndPoint, "id", setID, getID, xmlelement, mode); 68 74 XMLPortParam(PortalEndPoint, "design", setTemplate, getTemplate, xmlelement, mode); … … 70 76 XMLPortParamExtern(PortalEndPoint, DistanceMultiTrigger, this->trigger_, "distance", setDistance, getDistance, xmlelement, mode); 71 77 XMLPortParamLoadOnly(PortalEndPoint, "target", setTarget, xmlelement, mode).defaultValues("Pawn"); 72 78 73 79 // Add the DistanceMultiTrigger as event source. 74 80 this->addEventSource(this->trigger_, EVENTFUNCTIONNAME); 75 81 76 82 if(mode == XMLPort::LoadObject) 77 83 { … … 83 89 { 84 90 SUPER(PortalEndPoint, XMLEventPort, xmlelement, mode); 85 91 86 92 XMLPortEventSink(PortalEndPoint, BaseObject, EVENTFUNCTIONNAME, execute, xmlelement, mode); 87 93 } … … 91 97 if(!this->isActive()) 92 98 return true; 93 99 94 100 MultiTriggerContainer * cont = orxonox_cast<MultiTriggerContainer *>(trigger); 95 101 if(cont == 0) 96 102 return true; 97 103 98 104 DistanceMultiTrigger * originatingTrigger = orxonox_cast<DistanceMultiTrigger *>(cont->getOriginator()); 99 105 if(originatingTrigger == 0) … … 101 107 return true; 102 108 } 103 109 104 110 MobileEntity * entity = orxonox_cast<MobileEntity *>(cont->getData()); 105 111 if(entity == 0) 106 112 return true; 107 113 108 114 if(bTriggered) 109 115 { … … 117 123 this->recentlyJumpedOut_.erase(entity); 118 124 } 119 125 120 126 return true; 121 127 } … … 124 130 { 125 131 SUPER(PortalEndPoint, changedActivity); 126 132 127 133 this->setRadarVisibility(this->isActive()); 128 134 } -
code/trunk/src/modules/portals/PortalEndPoint.h
r8706 r8767 38 38 #include "portals/PortalsPrereqs.h" 39 39 40 #include <map> 40 41 #include <set> 41 42 #include <string> 42 #include <map> 43 44 #include "core/EventIncludes.h" 43 45 44 46 #include "worldentities/StaticEntity.h" 45 47 #include "interfaces/RadarViewable.h" 46 #include "graphics/Billboard.h"47 48 #include "objects/triggers/DistanceMultiTrigger.h" 48 #include "core/EventIncludes.h"49 #include <ctime>50 49 51 50 namespace orxonox … … 54 53 @brief 55 54 A PortalEndPoint serves as portal entrance and/or exit. 56 55 57 56 @ingroup Portals 58 57 */ 59 58 60 59 class _PortalsExport PortalEndPoint : public StaticEntity, public RadarViewable 61 60 { … … 63 62 PortalEndPoint(BaseObject* creator); 64 63 virtual ~PortalEndPoint(); 65 64 66 65 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 67 66 virtual void changedActivity(void); 68 67 69 68 inline void setTarget(const std::string & target) //!< add types which are allowed to activate the PortalEndPoint 70 69 { this->trigger_->addTarget(target); } 71 70 72 71 void XMLEventPort(Element& xmlelement, XMLPort::Mode mode); 73 72 static std::map<unsigned int, PortalEndPoint *> idMap_s; //!< Maps the id of each PortalEndPoint to a pointer to that PortalEndPoint … … 78 77 inline void setID(unsigned int id) 79 78 { this->id_ = id; } 80 79 81 80 inline unsigned int getID() const 82 81 { return this->id_; } 83 82 84 83 /// \brief Set templateName_ (the name of the design Template) and add that Template to this Object 85 84 inline void setTemplate(const std::string & name) … … 99 98 * \param entity The Entity which should jump out of this portal */ 100 99 void jumpOut(MobileEntity * entity); 101 100 102 101 /** \brief Tells wether a certain Entity is allowed to enter the PortalEndPoint? 103 102 @return @c true if the entity not just came out of this portal and the reenterDelay has expired for it, @c false otherwise … … 105 104 bool letsEnter(MobileEntity* entity); 106 105 protected: 107 106 108 107 private: 109 108 static const std::string EVENTFUNCTIONNAME; //!< = "execute" 110 109 111 110 unsigned int id_; //!< the hopefully (depends on the writer of the levelfile) unique id, which is used to establish links between PortalEndPoints 112 111 DistanceMultiTrigger * trigger_; //!< the DistanceMultiTrigger which notices near entities of the defined type -
code/trunk/src/modules/portals/PortalLink.cc
r8706 r8767 28 28 29 29 #include "PortalLink.h" 30 31 #include "core/CoreIncludes.h" 30 32 #include "core/XMLPort.h" 31 #include "objects/triggers/MultiTriggerContainer.h" 33 32 34 #include "worldentities/MobileEntity.h" 33 35 … … 37 39 38 40 std::map<PortalEndPoint *, PortalEndPoint *> PortalLink::links_s; 39 41 40 42 PortalLink::PortalLink(BaseObject* creator) : BaseObject(creator), fromID_(0), toID_(0), from_(0), to_(0) 41 43 { 42 44 RegisterObject(PortalLink); 43 45 } 44 46 45 47 PortalLink::~PortalLink() 46 48 { 47 49 48 50 } 49 51 50 52 void PortalLink::XMLPort(Element& xmlelement, XMLPort::Mode mode) 51 53 { … … 54 56 XMLPortParam(PortalLink, "toID", setToID, getToID, xmlelement, mode); 55 57 58 // Beware: This means, that the PortalEndPoints must exist before the PortalLink is created. 56 59 if(mode == XMLPort::LoadObject) 57 60 { … … 65 68 { 66 69 if(entrance == 0) 67 {68 70 return; 69 } 70 71 71 72 std::map<PortalEndPoint *, PortalEndPoint *>::iterator endpoints = PortalLink::links_s.find(entrance); 72 73 73 if(endpoints == PortalLink::links_s.end()) // entrance has no corresponding exit 74 74 return; -
code/trunk/src/modules/portals/PortalLink.h
r8706 r8767 37 37 38 38 #include "portals/PortalsPrereqs.h" 39 #include "tools/interfaces/Tickable.h"40 #include "core/BaseObject.h"41 #include "PortalEndPoint.h"42 #include "objects/eventsystem/EventListener.h"43 39 44 40 #include <map> 41 42 #include "PortalEndPoint.h" 43 44 #include "core/BaseObject.h" 45 45 46 46 namespace orxonox … … 57 57 virtual ~PortalLink(); 58 58 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 59 59 60 inline void setFromID(unsigned int from) //!< set the ID of the PortalEndPoint which should act as the entrance of this link 60 { 61 this->fromID_ = from; 62 } 61 { this->fromID_ = from; } 63 62 inline unsigned int getFromID(unsigned int) const 64 { 65 return this->fromID_; 66 } 63 { return this->fromID_; } 67 64 inline void setToID(unsigned int to) //!< set the ID of the PortalEndPoint which should act as the exit of this link 68 { 69 this->toID_ = to; 70 } 65 { this->toID_ = to; } 71 66 inline unsigned int getToID(unsigned int) const 72 { 73 return this->toID_; 74 } 67 { return this->toID_; } 75 68 /*! \brief Let an entity enter a certain PortalEndPoint 76 69 \param entity pointer to the entity which is entering a PortalEndPoint -
code/trunk/src/modules/weapons/projectiles/BasicProjectile.cc
r8706 r8767 52 52 // Default damage must be zero, otherwise it would be above zero if no settings are made in the weaponsettings xml file. 53 53 // same thing for all weaponmodes files 54 this->damage_ = 0 ;55 this->healthdamage_ = 0 ;56 this->shielddamage_ = 0 ;54 this->damage_ = 0.0f; 55 this->healthdamage_ = 0.0f; 56 this->shielddamage_ = 0.0f; 57 57 } 58 58
Note: See TracChangeset
for help on using the changeset viewer.