[Orxonox-commit 1006] r5727 - in code/branches/libraries2/src: modules/questsystem orxonox orxonox/interfaces orxonox/objects/worldentities/triggers
landauf at orxonox.net
landauf at orxonox.net
Mon Aug 31 21:18:17 CEST 2009
Author: landauf
Date: 2009-08-31 21:18:17 +0200 (Mon, 31 Aug 2009)
New Revision: 5727
Added:
code/branches/libraries2/src/orxonox/interfaces/PlayerTrigger.h
Removed:
code/branches/libraries2/src/orxonox/objects/worldentities/triggers/PlayerTrigger.cc
code/branches/libraries2/src/orxonox/objects/worldentities/triggers/PlayerTrigger.h
Modified:
code/branches/libraries2/src/modules/questsystem/QuestEffectBeacon.cc
code/branches/libraries2/src/orxonox/OrxonoxPrereqs.h
code/branches/libraries2/src/orxonox/interfaces/InterfaceCompilation.cc
code/branches/libraries2/src/orxonox/objects/worldentities/triggers/CMakeLists.txt
code/branches/libraries2/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc
code/branches/libraries2/src/orxonox/objects/worldentities/triggers/DistanceTrigger.h
Log:
PlayerTrigger is now an interface instead of a child of Trigger. DistanceTrigger inherits now from Trigger AND PlayerTrigger.
Modified: code/branches/libraries2/src/modules/questsystem/QuestEffectBeacon.cc
===================================================================
--- code/branches/libraries2/src/modules/questsystem/QuestEffectBeacon.cc 2009-08-31 19:15:54 UTC (rev 5726)
+++ code/branches/libraries2/src/modules/questsystem/QuestEffectBeacon.cc 2009-08-31 19:18:17 UTC (rev 5727)
@@ -37,7 +37,7 @@
#include "core/XMLPort.h"
#include "core/EventIncludes.h"
#include "objects/worldentities/pawns/Pawn.h"
-#include "objects/worldentities/triggers/PlayerTrigger.h"
+#include "interfaces/PlayerTrigger.h"
#include "QuestEffect.h"
namespace orxonox
Modified: code/branches/libraries2/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- code/branches/libraries2/src/orxonox/OrxonoxPrereqs.h 2009-08-31 19:15:54 UTC (rev 5726)
+++ code/branches/libraries2/src/orxonox/OrxonoxPrereqs.h 2009-08-31 19:18:17 UTC (rev 5727)
@@ -73,6 +73,7 @@
class GametypeMessageListener;
class NotificationListener;
class PawnListener;
+ class PlayerTrigger;
class RadarListener;
class RadarViewable;
class Rewardable;
@@ -160,7 +161,6 @@
class Trigger;
class DistanceTrigger;
class EventTrigger;
- class PlayerTrigger;
class CheckPoint;
// weaponsystem
Modified: code/branches/libraries2/src/orxonox/interfaces/InterfaceCompilation.cc
===================================================================
--- code/branches/libraries2/src/orxonox/interfaces/InterfaceCompilation.cc 2009-08-31 19:15:54 UTC (rev 5726)
+++ code/branches/libraries2/src/orxonox/interfaces/InterfaceCompilation.cc 2009-08-31 19:18:17 UTC (rev 5727)
@@ -34,6 +34,7 @@
#include "GametypeMessageListener.h"
#include "PawnListener.h"
+#include "PlayerTrigger.h"
#include "RadarListener.h"
#include "Rewardable.h"
#include "TeamColourable.h"
@@ -83,7 +84,7 @@
//----------------------------
Rewardable::Rewardable()
{
- RegisterObject(Rewardable);
+ RegisterRootObject(Rewardable);
}
//----------------------------
@@ -91,6 +92,17 @@
//----------------------------
NotificationListener::NotificationListener()
{
- RegisterObject(NotificationListener);
+ RegisterRootObject(NotificationListener);
}
+
+ //----------------------------
+ // PlayerTrigger
+ //----------------------------
+ PlayerTrigger::PlayerTrigger()
+ {
+ RegisterRootObject(PlayerTrigger);
+
+ this->player_ = NULL;
+ this->isForPlayer_ = true;
+ }
}
Copied: code/branches/libraries2/src/orxonox/interfaces/PlayerTrigger.h (from rev 5722, code/branches/libraries2/src/orxonox/objects/worldentities/triggers/PlayerTrigger.h)
===================================================================
--- code/branches/libraries2/src/orxonox/interfaces/PlayerTrigger.h (rev 0)
+++ code/branches/libraries2/src/orxonox/interfaces/PlayerTrigger.h 2009-08-31 19:18:17 UTC (rev 5727)
@@ -0,0 +1,92 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Damian 'Mozork' Frick
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file
+ @brief
+ Definition of the PlayerTrigger class.
+*/
+
+#ifndef _PlayerTrigger_H__
+#define _PlayerTrigger_H__
+
+#include "OrxonoxPrereqs.h"
+#include "core/OrxonoxClass.h"
+
+namespace orxonox
+{
+ /**
+ @brief
+ A PlayerTrigger is a trigger which is normally triggered by ControllableEntities and can as such return a pointer to the ControllableEntity which triggered it.
+ @author
+ Damian 'Mozork' Frick
+ */
+ class _OrxonoxExport PlayerTrigger : virtual public OrxonoxClass
+ {
+ public:
+ PlayerTrigger();
+ virtual ~PlayerTrigger() {}
+
+ /**
+ @brief Returns the player that triggered the PlayerTrigger.
+ @return Returns a pointer to the ControllableEntity that triggered the PlayerTrigger.
+ */
+ inline Pawn* getTriggeringPlayer(void) const
+ { return this->player_; }
+
+ /**
+ @brief Checks whether the PlayerTrigger normally returns a ControllableEntity.
+ @return Returns true if the PlayerTrigger normally returns a ControllableEntity.
+ */
+ inline bool isForPlayer(void) const
+ { return this->isForPlayer_; }
+
+ protected:
+ /**
+ @brief Set the player that triggered the PlayerTrigger. This is normally done by classes inheriting vom PlayerTrigger.
+ @param player A pointer to the ControllableEntity that triggered the PlayerTrigger.
+ */
+ inline void setTriggeringPlayer(Pawn* player)
+ { this->player_ = player; }
+
+ /**
+ @brief Set whether the PlayerTrigger normally is triggered by ControllableEntities.
+ @param isForPlayer Should be true when the PlayerTrigger should be set to normally be triggered by ControllableEntities, false if not.
+ */
+ inline void setForPlayer(bool isForPlayer)
+ { this->isForPlayer_ = isForPlayer; }
+
+ private:
+ Pawn* player_; //!< The player that triggered the PlayerTrigger.
+ bool isForPlayer_; //!< Is true when the PlayerTrigger should be set to normally be triggered by ControllableEntities.
+
+ };
+
+}
+
+#endif /* _PlayerTrigger_H__ */
Modified: code/branches/libraries2/src/orxonox/objects/worldentities/triggers/CMakeLists.txt
===================================================================
--- code/branches/libraries2/src/orxonox/objects/worldentities/triggers/CMakeLists.txt 2009-08-31 19:15:54 UTC (rev 5726)
+++ code/branches/libraries2/src/orxonox/objects/worldentities/triggers/CMakeLists.txt 2009-08-31 19:18:17 UTC (rev 5727)
@@ -2,6 +2,5 @@
Trigger.cc
DistanceTrigger.cc
EventTrigger.cc
- PlayerTrigger.cc
CheckPoint.cc
)
Modified: code/branches/libraries2/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc
===================================================================
--- code/branches/libraries2/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc 2009-08-31 19:15:54 UTC (rev 5726)
+++ code/branches/libraries2/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc 2009-08-31 19:18:17 UTC (rev 5727)
@@ -36,7 +36,7 @@
{
CreateFactory(DistanceTrigger);
- DistanceTrigger::DistanceTrigger(BaseObject* creator) : PlayerTrigger(creator)
+ DistanceTrigger::DistanceTrigger(BaseObject* creator) : Trigger(creator)
{
RegisterObject(DistanceTrigger);
Modified: code/branches/libraries2/src/orxonox/objects/worldentities/triggers/DistanceTrigger.h
===================================================================
--- code/branches/libraries2/src/orxonox/objects/worldentities/triggers/DistanceTrigger.h 2009-08-31 19:15:54 UTC (rev 5726)
+++ code/branches/libraries2/src/orxonox/objects/worldentities/triggers/DistanceTrigger.h 2009-08-31 19:18:17 UTC (rev 5727)
@@ -33,11 +33,12 @@
#include <set>
#include "core/ClassTreeMask.h"
-#include "PlayerTrigger.h"
+#include "Trigger.h"
+#include "interfaces/PlayerTrigger.h"
namespace orxonox
{
- class _OrxonoxExport DistanceTrigger : public PlayerTrigger
+ class _OrxonoxExport DistanceTrigger : public Trigger, public PlayerTrigger
{
public:
DistanceTrigger(BaseObject* creator);
@@ -66,7 +67,7 @@
private:
std::set<Ogre::Node*> targetSet_;
float distance_;
-
+
};
}
Deleted: code/branches/libraries2/src/orxonox/objects/worldentities/triggers/PlayerTrigger.cc
===================================================================
--- code/branches/libraries2/src/orxonox/objects/worldentities/triggers/PlayerTrigger.cc 2009-08-31 19:15:54 UTC (rev 5726)
+++ code/branches/libraries2/src/orxonox/objects/worldentities/triggers/PlayerTrigger.cc 2009-08-31 19:18:17 UTC (rev 5727)
@@ -1,68 +0,0 @@
-/*
- * ORXONOX - the hottest 3D action shooter ever to exist
- * > www.orxonox.net <
- *
- *
- * License notice:
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Author:
- * Damian 'Mozork' Frick
- * Co-authors:
- * ...
- *
- */
-
-/**
- @file
- @brief
- Implementation of the PlayerTrigger class.
-*/
-
-#include "PlayerTrigger.h"
-#include "core/CoreIncludes.h"
-
-namespace orxonox
-{
- /**
- @brief
- Constructor. Registers the object and initializes defaults.
- */
- PlayerTrigger::PlayerTrigger(BaseObject* creator) : Trigger(creator)
- {
- RegisterObject(PlayerTrigger);
-
- this->player_ = NULL;
- this->isForPlayer_ = true;
- }
-
- /**
- @brief
- Destructor.
- */
- PlayerTrigger::~PlayerTrigger()
- {
- }
-
- /**
- @brief
- Method for creating a QuestEffectBeacon object through XML.
- */
- void PlayerTrigger::XMLPort(Element& xmlelement, XMLPort::Mode mode)
- {
- SUPER(PlayerTrigger, XMLPort, xmlelement, mode);
- }
-}
Deleted: code/branches/libraries2/src/orxonox/objects/worldentities/triggers/PlayerTrigger.h
===================================================================
--- code/branches/libraries2/src/orxonox/objects/worldentities/triggers/PlayerTrigger.h 2009-08-31 19:15:54 UTC (rev 5726)
+++ code/branches/libraries2/src/orxonox/objects/worldentities/triggers/PlayerTrigger.h 2009-08-31 19:18:17 UTC (rev 5727)
@@ -1,96 +0,0 @@
-/*
- * ORXONOX - the hottest 3D action shooter ever to exist
- * > www.orxonox.net <
- *
- *
- * License notice:
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Author:
- * Damian 'Mozork' Frick
- * Co-authors:
- * ...
- *
- */
-
-/**
- @file
- @brief
- Definition of the PlayerTrigger class.
-*/
-
-#ifndef _PlayerTrigger_H__
-#define _PlayerTrigger_H__
-
-#include "OrxonoxPrereqs.h"
-#include "Trigger.h"
-
-namespace orxonox
-{
- /**
- @brief
- A PlayerTrigger is a trigger which is normally triggered by ControllableEntities and can as such return a pointer to the ControllableEntity which triggered it.
- @author
- Damian 'Mozork' Frick
- */
- class _OrxonoxExport PlayerTrigger : public Trigger
- {
- public:
- PlayerTrigger(BaseObject* creator);
- virtual ~PlayerTrigger();
-
- virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a PlayerTrigger object through XML.
-
- /**
- @brief Returns the player that triggered the PlayerTrigger.
- @return Returns a pointer to the ControllableEntity that triggered the PlayerTrigger.
- */
- inline Pawn* getTriggeringPlayer(void) const
- { return this->player_; }
-
- /**
- @brief Checks whether the PlayerTrigger normally returns a ControllableEntity.
- @return Returns true if the PlayerTrigger normally returns a ControllableEntity.
- */
- inline bool isForPlayer(void) const
- { return this->isForPlayer_; }
-
- protected:
- virtual bool isTriggered(TriggerMode::Value mode) = 0;
-
- /**
- @brief Set the player that triggered the PlayerTrigger. This is normally done by classes inheriting vom PlayerTrigger.
- @param player A pointer to the ControllableEntity that triggered the PlayerTrigger.
- */
- inline void setTriggeringPlayer(Pawn* player)
- { this->player_ = player; }
-
- /**
- @brief Set whether the PlayerTrigger normally is triggered by ControllableEntities.
- @param isForPlayer Should be true when the PlayerTrigger should be set to normally be triggered by ControllableEntities, false if not.
- */
- inline void setForPlayer(bool isForPlayer)
- { this->isForPlayer_ = isForPlayer; }
-
- private:
- Pawn* player_; //!< The player that triggered the PlayerTrigger.
- bool isForPlayer_; //!< Is true when the PlayerTrigger should be set to normally be triggered by ControllableEntities.
-
- };
-
-}
-
-#endif /* _PlayerTrigger_H__ */
More information about the Orxonox-commit
mailing list