Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 2, 2015, 11:20:45 PM (9 years ago)
Author:
landauf
Message:

use the generic UpdateListener interface to receive calls to preUpdate() and postUpdate() instead of limiting this functionality to singletons.

Location:
code/branches/core7/src/orxonox
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core7/src/orxonox/PawnManager.cc

    r10407 r10413  
    3737    ManageScopedSingleton(PawnManager, ScopeID::Root, false);
    3838
    39     RegisterAbstractClass(PawnManager).inheritsFrom<Tickable>();
     39    RegisterAbstractClass(PawnManager).inheritsFrom<UpdateListener>();
    4040
    4141    PawnManager::PawnManager()
  • code/branches/core7/src/orxonox/PawnManager.h

    r8351 r10413  
    3333
    3434#include "util/Singleton.h"
    35 #include "tools/interfaces/Tickable.h"
     35#include "core/UpdateListener.h"
    3636
    3737namespace orxonox
    3838{
    39     class _OrxonoxExport PawnManager : public Singleton<PawnManager>, public Tickable
     39    class _OrxonoxExport PawnManager : public Singleton<PawnManager>, public UpdateListener
    4040    {
    4141            friend class Singleton<PawnManager>;
     
    4545
    4646            virtual void preUpdate(const Clock& time);
     47            virtual void postUpdate(const Clock& time) { /*no action*/ }
    4748
    4849        private:
  • code/branches/core7/src/orxonox/ShipPartManager.cc

    r10407 r10413  
    3737    ManageScopedSingleton(ShipPartManager, ScopeID::Root, false);
    3838
    39     RegisterAbstractClass(ShipPartManager).inheritsFrom<Tickable>();
     39    RegisterAbstractClass(ShipPartManager).inheritsFrom<UpdateListener>();
    4040
    4141    ShipPartManager::ShipPartManager()
  • code/branches/core7/src/orxonox/ShipPartManager.h

    r10262 r10413  
    3333
    3434#include "util/Singleton.h"
    35 #include "tools/interfaces/Tickable.h"
     35#include "core/UpdateListener.h"
    3636
    3737namespace orxonox
    3838{
    39     class _OrxonoxExport ShipPartManager : public Singleton<ShipPartManager>, public Tickable
     39    class _OrxonoxExport ShipPartManager : public Singleton<ShipPartManager>, public UpdateListener
    4040    {
    4141            friend class Singleton<ShipPartManager>;
     
    4545
    4646            virtual void preUpdate(const Clock& time);
     47            virtual void postUpdate(const Clock& time) { /*no action*/ }
    4748
    4849        private:
  • code/branches/core7/src/orxonox/overlays/InGameConsole.cc

    r10407 r10413  
    6767    ManageScopedSingleton(InGameConsole, ScopeID::Graphics, false);
    6868
    69     RegisterAbstractClass(InGameConsole).inheritsFrom<WindowEventListener>();
     69    RegisterAbstractClass(InGameConsole).inheritsFrom<WindowEventListener>().inheritsFrom<UpdateListener>();
    7070
    7171    /**
  • code/branches/core7/src/orxonox/overlays/InGameConsole.h

    r8858 r10413  
    3939#include "core/WindowEventListener.h"
    4040#include "core/command/Shell.h"
     41#include "core/UpdateListener.h"
    4142
    4243namespace orxonox
    4344{
    44     class _OrxonoxExport InGameConsole : public Singleton<InGameConsole>, public ShellListener, public WindowEventListener
     45    class _OrxonoxExport InGameConsole : public Singleton<InGameConsole>, public ShellListener, public WindowEventListener, public UpdateListener
    4546    {
    4647        friend class Singleton<InGameConsole>;
     
    5354
    5455        void preUpdate(const Clock& time);
     56        void postUpdate(const Clock& time) { /*no action*/ }
    5557
    5658        static void openConsole();
  • code/branches/core7/src/orxonox/sound/SoundManager.cc

    r10407 r10413  
    6666    }
    6767
    68     RegisterAbstractClass(SoundManager).inheritsFrom<Configurable>();
     68    RegisterAbstractClass(SoundManager).inheritsFrom<Configurable>().inheritsFrom<UpdateListener>();
    6969
    7070    SoundManager::SoundManager()
  • code/branches/core7/src/orxonox/sound/SoundManager.h

    r9667 r10413  
    4141#include "core/config/Configurable.h"
    4242#include "core/object/SmartPtr.h"
     43#include "core/UpdateListener.h"
    4344
    4445// tolua_begin
     
    5960    class _OrxonoxExport SoundManager
    6061    // tolua_end
    61         : public Singleton<SoundManager>, public Configurable
     62        : public Singleton<SoundManager>, public Configurable, public UpdateListener
    6263    { // tolua_export
    6364        friend class Singleton<SoundManager>;
     
    6869
    6970        void preUpdate(const Clock& time);
     71        void postUpdate(const Clock& time) { /*no action*/ }
    7072        void setConfigValues();
    7173
Note: See TracChangeset for help on using the changeset viewer.