Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8651


Ignore:
Timestamp:
May 28, 2011, 10:11:23 PM (14 years ago)
Author:
scheusso
Message:

first attempt to make notifications synchronisable
not yet succeeded though (some callbacks missing)

Location:
code/branches/presentation/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation/src/modules/notifications/NotificationQueue.cc

    r8637 r8651  
    5252        The creator of the NotificationQueue.
    5353    */
    54     NotificationQueue::NotificationQueue(BaseObject* creator) : BaseObject(creator), registered_(false)
     54    NotificationQueue::NotificationQueue(BaseObject* creator) : BaseObject(creator), Synchronisable(creator), registered_(false)
    5555    {
    5656        RegisterObject(NotificationQueue);
    5757
    5858        this->initialize();
     59        this->registerVariables();
    5960    }
    6061
     
    161162        this->create();
    162163    }
     164   
     165   
     166    /**
     167    @brief
     168        Registers Variables to be Synchronised.
     169        Registers Variables which have to be synchronised to the network system.
     170      */
     171    void NotificationQueue::registerVariables()
     172    {
     173        registerVariable( this->maxSize_, VariableDirection::ToClient );
     174        registerVariable( this->targets_, VariableDirection::ToClient );
     175        registerVariable( this->displayTime_, VariableDirection::ToClient );
     176    }
     177
    163178
    164179    /**
  • code/branches/presentation/src/modules/notifications/NotificationQueue.h

    r8637 r8651  
    4747#include "core/BaseObject.h"
    4848#include "tools/interfaces/Tickable.h"
     49#include "network/synchronisable/Synchronisable.h"
    4950
    5051namespace orxonox
     
    8990    @ingroup Notifications
    9091    */
    91     class _NotificationsExport NotificationQueue : public BaseObject, public Tickable
     92    class _NotificationsExport NotificationQueue : public BaseObject, public Tickable, public Synchronisable
    9293    {
    9394
     
    99100            virtual void tick(float dt); // To update from time to time.
    100101            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    101 
     102            void registerVariables();
     103           
    102104            void update(void); // Updates the NotificationQueue.
    103105            void update(Notification* notification, const std::time_t & time); // Updates the NotificationQueue by adding an new Notification.
  • code/branches/presentation/src/modules/notifications/NotificationQueueCEGUI.cc

    r8645 r8651  
    5959
    6060        this->initialize();
     61        this->registerVariables();
    6162    }
    6263   
     
    9091        XMLPortParam(NotificationQueueCEGUI, "alignment", setAlignment, getAlignment, xmlelement, mode);
    9192        XMLPortParam(NotificationQueueCEGUI, "displaySize", setDisplaySize, getDisplaySize, xmlelement, mode);
     93    }
     94   
     95    void NotificationQueueCEGUI::registerVariables()
     96    {
     97        registerVariable( this->position_, VariableDirection::ToClient );
     98        registerVariable( this->fontSize_, VariableDirection::ToClient );
     99        registerVariable( this->fontColor_, VariableDirection::ToClient );
     100        registerVariable( this->alignment_, VariableDirection::ToClient );
     101        registerVariable( this->displaySize_, VariableDirection::ToClient );
    92102    }
    93103
  • code/branches/presentation/src/modules/notifications/NotificationQueueCEGUI.h

    r8645 r8651  
    7474
    7575            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     76            void registerVariables();
    7677
    7778            void destroy(bool noGraphics = false); // Destroys the NotificationQueue.
  • code/branches/presentation/src/orxonox/worldentities/pawns/SpaceShip.cc

    r8648 r8651  
    118118        XMLPortParamVariable(SpaceShip, "boostRate", boostRate_, xmlelement, mode);
    119119        XMLPortParamVariable(SpaceShip, "boostCooldownDuration", boostCooldownDuration_, xmlelement, mode);
    120                 XMLPortParamVariable(SpaceShip, "shakeFrequency", shakeFrequency_, xmlelement, mode);
     120        XMLPortParamVariable(SpaceShip, "shakeFrequency", shakeFrequency_, xmlelement, mode);
    121121        XMLPortParamVariable(SpaceShip, "shakeAmplitude", shakeAmplitude_, xmlelement, mode);
    122                 XMLPortParamVariable(SpaceShip, "lift", lift_, xmlelement, mode);
     122        XMLPortParamVariable(SpaceShip, "lift", lift_, xmlelement, mode);
    123123        XMLPortParamVariable(SpaceShip, "stallSpeed", stallSpeed_, xmlelement, mode);
    124124
Note: See TracChangeset for help on using the changeset viewer.