Ocular Engine
ARoutine.hpp
1 
17 #pragma once
18 #ifndef __H__OCULAR_CORE_SCENE_AROUTINE__H__
19 #define __H__OCULAR_CORE_SCENE_AROUTINE__H__
20 
21 #include "Object.hpp"
22 #include "Events/AEventListener.hpp"
23 #include "Scene/RoutineRegistrar.hpp"
24 #include "Priority.hpp"
25 
26 //------------------------------------------------------------------------------------------
27 
32 namespace Ocular
33 {
38  namespace Core
39  {
40  class SceneObject;
41 
59  class ARoutine : public Object, public AEventListener
60  {
61  friend class SceneObject;
62 
63  public:
64 
65  ARoutine(std::string const& name, std::string const& type);
66  virtual ~ARoutine();
67 
68  bool operator<(ARoutine const& rhs);
69  bool operator>(ARoutine const& rhs);
70 
75  virtual void onSceneStart();
76 
81  virtual void onSceneEnd();
82 
89  virtual void onCreation();
90 
94  virtual void onDestruction();
95 
99  virtual void onPause();
100 
104  virtual void onUnpause();
105 
115  virtual void onUpdate(float const delta);
116 
134  virtual float onTimedUpdate();
135 
139  virtual void onPreRender();
140 
144  virtual void onPostRender();
145 
152  virtual bool onEvent(std::shared_ptr<AEvent> event);
153 
157  Priority getPriorityLevel() const;
158 
162  SceneObject* getParent() const;
163 
167  std::string const& getName() const;
168 
169  protected:
170 
171  virtual void setParent(SceneObject* object);
172  void setName(std::string const& name);
173 
174  Priority m_Priority;
176 
177  private:
178 
179  };
180  }
184 }
189 //------------------------------------------------------------------------------------------
190 
191 #endif
virtual void onUnpause()
Definition: ARoutine.cpp:85
SceneObject * m_Parent
The SceneObject instance that this routine is attached to.
Definition: ARoutine.hpp:175
virtual void onSceneStart()
Definition: ARoutine.cpp:60
virtual void onUpdate(float const delta)
Definition: ARoutine.cpp:90
virtual void onCreation()
Definition: ARoutine.cpp:70
virtual void onPreRender()
Definition: ARoutine.cpp:100
Priority m_Priority
Priority level of this Routine in the Routine Queue.
Definition: ARoutine.hpp:174
Definition: AEventListener.hpp:43
virtual void onPause()
Definition: ARoutine.cpp:80
SceneObject * getParent() const
Definition: ARoutine.cpp:120
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70
virtual void onSceneEnd()
Definition: ARoutine.cpp:65
Definition: ARoutine.hpp:59
std::string const & getName() const
Definition: ARoutine.cpp:125
Priority getPriorityLevel() const
Definition: ARoutine.cpp:115
Definition: SceneObject.hpp:93
virtual void onPostRender()
Definition: ARoutine.cpp:105
virtual void onDestruction()
Definition: ARoutine.cpp:75
virtual bool onEvent(std::shared_ptr< AEvent > event)
Definition: ARoutine.cpp:110
Base class of all representable Ocular constructs.
Definition: Object.hpp:44
virtual float onTimedUpdate()
Definition: ARoutine.cpp:95