From 2eefd144705db85a922b8416288b397223bc8610 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Tue, 10 Sep 2013 21:02:16 +0200 Subject: [PATCH] [DEV] start think at the particule interface --- ege/Particule.h | 22 +++++++++++++++------- ege/ParticuleEngine.h | 11 +++++++++-- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/ege/Particule.h b/ege/Particule.h index 4282677..6780a29 100644 --- a/ege/Particule.h +++ b/ege/Particule.h @@ -9,19 +9,27 @@ #ifndef __EGE_PARTICULE_H__ #define __EGE_PARTICULE_H__ +#include +#include + + namespace ege { + /** + * @brief The particule class is an element with no control, when it will be created, + * it does not have any control, for example smoke or reactor generation ... + * or explosion particule ... + */ class Particule { private: etk::UString m_name; //!< name of the particule - bool m_standalone; //!< if true, no control of the particule... public: /** * @brief Constructor. * @param[in] _name Name of the particule. * @param[in] _standalone The particule are created and have there own life (no dynamic control) */ - Particule(const etk::UString& _name, bool _standalone) : m_name(_name) { }; + Particule(ege::Environement& _env, const etk::UString& _name) : m_name(_name) { }; /** * @brief Destructor. */ @@ -31,16 +39,16 @@ namespace ege { * @return the particule name. */ const etk::UString& GetName(void) { return m_name; }; - /** - * @brief Get the standalone status. - * @return true if standalone - */ - bool GetStandalone(void) { return m_standalone; }; /** * @brief Update the paticule properties * @param[in] _delta Delta time from the previous call */ virtual void Update(float _delta) { }; + /** + * @brief Draw the current particule + */ + virtual void Draw(void) { }; + // note : For multiple instance only (standalone==false) /** * diff --git a/ege/ParticuleEngine.h b/ege/ParticuleEngine.h index fc5a941..a38d06e 100644 --- a/ege/ParticuleEngine.h +++ b/ege/ParticuleEngine.h @@ -9,13 +9,20 @@ #ifndef __EGE_PARTICULE_ENGINE_H__ #define __EGE_PARTICULE_ENGINE_H__ +#include +#include +#include + namespace ege { class PariculeEngine { public: - PariculeEngine(ege::Environement& _env); + PariculeEngine(ege::Environement& _env); // note : Need the engine to register has an dynamic element ... (the first ...) ~PariculeEngine(void); - Keep( + Particule* LocalKeep(const etk::UString& _name); + void LocalRelease(Particule* _particule); + void Update(float _deltaTime); + void Draw(void); }; };