[Orxonox-commit 3977] r8651 - in code/branches/presentation/src: modules/notifications orxonox/worldentities/pawns
scheusso at orxonox.net
scheusso at orxonox.net
Sat May 28 22:11:23 CEST 2011
Author: scheusso
Date: 2011-05-28 22:11:23 +0200 (Sat, 28 May 2011)
New Revision: 8651
Modified:
code/branches/presentation/src/modules/notifications/NotificationQueue.cc
code/branches/presentation/src/modules/notifications/NotificationQueue.h
code/branches/presentation/src/modules/notifications/NotificationQueueCEGUI.cc
code/branches/presentation/src/modules/notifications/NotificationQueueCEGUI.h
code/branches/presentation/src/orxonox/worldentities/pawns/SpaceShip.cc
Log:
first attempt to make notifications synchronisable
not yet succeeded though (some callbacks missing)
Modified: code/branches/presentation/src/modules/notifications/NotificationQueue.cc
===================================================================
--- code/branches/presentation/src/modules/notifications/NotificationQueue.cc 2011-05-28 19:57:45 UTC (rev 8650)
+++ code/branches/presentation/src/modules/notifications/NotificationQueue.cc 2011-05-28 20:11:23 UTC (rev 8651)
@@ -51,11 +51,12 @@
@param creator
The creator of the NotificationQueue.
*/
- NotificationQueue::NotificationQueue(BaseObject* creator) : BaseObject(creator), registered_(false)
+ NotificationQueue::NotificationQueue(BaseObject* creator) : BaseObject(creator), Synchronisable(creator), registered_(false)
{
RegisterObject(NotificationQueue);
this->initialize();
+ this->registerVariables();
}
// TODO move to docu.
@@ -160,7 +161,21 @@
this->create();
}
+
+
+ /**
+ @brief
+ Registers Variables to be Synchronised.
+ Registers Variables which have to be synchronised to the network system.
+ */
+ void NotificationQueue::registerVariables()
+ {
+ registerVariable( this->maxSize_, VariableDirection::ToClient );
+ registerVariable( this->targets_, VariableDirection::ToClient );
+ registerVariable( this->displayTime_, VariableDirection::ToClient );
+ }
+
/**
@brief
Updates the NotificationQueue.
Modified: code/branches/presentation/src/modules/notifications/NotificationQueue.h
===================================================================
--- code/branches/presentation/src/modules/notifications/NotificationQueue.h 2011-05-28 19:57:45 UTC (rev 8650)
+++ code/branches/presentation/src/modules/notifications/NotificationQueue.h 2011-05-28 20:11:23 UTC (rev 8651)
@@ -46,6 +46,7 @@
#include "core/BaseObject.h"
#include "tools/interfaces/Tickable.h"
+#include "network/synchronisable/Synchronisable.h"
namespace orxonox
{
@@ -88,7 +89,7 @@
@ingroup Notifications
*/
- class _NotificationsExport NotificationQueue : public BaseObject, public Tickable
+ class _NotificationsExport NotificationQueue : public BaseObject, public Tickable, public Synchronisable
{
public:
@@ -98,7 +99,8 @@
virtual void tick(float dt); // To update from time to time.
virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-
+ void registerVariables();
+
void update(void); // Updates the NotificationQueue.
void update(Notification* notification, const std::time_t & time); // Updates the NotificationQueue by adding an new Notification.
Modified: code/branches/presentation/src/modules/notifications/NotificationQueueCEGUI.cc
===================================================================
--- code/branches/presentation/src/modules/notifications/NotificationQueueCEGUI.cc 2011-05-28 19:57:45 UTC (rev 8650)
+++ code/branches/presentation/src/modules/notifications/NotificationQueueCEGUI.cc 2011-05-28 20:11:23 UTC (rev 8651)
@@ -58,6 +58,7 @@
RegisterObject(NotificationQueueCEGUI);
this->initialize();
+ this->registerVariables();
}
NotificationQueueCEGUI::~NotificationQueueCEGUI()
@@ -90,6 +91,15 @@
XMLPortParam(NotificationQueueCEGUI, "alignment", setAlignment, getAlignment, xmlelement, mode);
XMLPortParam(NotificationQueueCEGUI, "displaySize", setDisplaySize, getDisplaySize, xmlelement, mode);
}
+
+ void NotificationQueueCEGUI::registerVariables()
+ {
+ registerVariable( this->position_, VariableDirection::ToClient );
+ registerVariable( this->fontSize_, VariableDirection::ToClient );
+ registerVariable( this->fontColor_, VariableDirection::ToClient );
+ registerVariable( this->alignment_, VariableDirection::ToClient );
+ registerVariable( this->displaySize_, VariableDirection::ToClient );
+ }
/**
@brief
Modified: code/branches/presentation/src/modules/notifications/NotificationQueueCEGUI.h
===================================================================
--- code/branches/presentation/src/modules/notifications/NotificationQueueCEGUI.h 2011-05-28 19:57:45 UTC (rev 8650)
+++ code/branches/presentation/src/modules/notifications/NotificationQueueCEGUI.h 2011-05-28 20:11:23 UTC (rev 8651)
@@ -73,6 +73,7 @@
virtual ~NotificationQueueCEGUI();
virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+ void registerVariables();
void destroy(bool noGraphics = false); // Destroys the NotificationQueue.
Modified: code/branches/presentation/src/orxonox/worldentities/pawns/SpaceShip.cc
===================================================================
--- code/branches/presentation/src/orxonox/worldentities/pawns/SpaceShip.cc 2011-05-28 19:57:45 UTC (rev 8650)
+++ code/branches/presentation/src/orxonox/worldentities/pawns/SpaceShip.cc 2011-05-28 20:11:23 UTC (rev 8651)
@@ -117,9 +117,9 @@
XMLPortParamVariable(SpaceShip, "boostPowerRate", boostPowerRate_, xmlelement, mode);
XMLPortParamVariable(SpaceShip, "boostRate", boostRate_, xmlelement, mode);
XMLPortParamVariable(SpaceShip, "boostCooldownDuration", boostCooldownDuration_, xmlelement, mode);
- XMLPortParamVariable(SpaceShip, "shakeFrequency", shakeFrequency_, xmlelement, mode);
+ XMLPortParamVariable(SpaceShip, "shakeFrequency", shakeFrequency_, xmlelement, mode);
XMLPortParamVariable(SpaceShip, "shakeAmplitude", shakeAmplitude_, xmlelement, mode);
- XMLPortParamVariable(SpaceShip, "lift", lift_, xmlelement, mode);
+ XMLPortParamVariable(SpaceShip, "lift", lift_, xmlelement, mode);
XMLPortParamVariable(SpaceShip, "stallSpeed", stallSpeed_, xmlelement, mode);
XMLPortObject(SpaceShip, Engine, "engines", addEngine, getEngine, xmlelement, mode);
More information about the Orxonox-commit
mailing list