cocos2d-x  3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PUObserver Class Referenceabstract

#include <CCPUObserver.h>

Inheritance diagram for PUObserver:
Ref PUOnClearObserver PUOnCollisionObserver PUOnCountObserver PUOnEmissionObserver PUOnEventFlagObserver PUOnExpireObserver PUOnPositionObserver PUOnQuotaObserver PUOnRandomObserver PUOnTimeObserver PUOnVelocityObserver

Public Types

typedef std::vector
< PUEventHandler * >::iterator 
ParticleEventHandlerIterator
typedef std::vector
< PUEventHandler * >
::const_iterator 
ParticleEventHandlerConstIterator
typedef std::vector
< PUEventHandler * > 
ParticleEventHandlerList

Public Member Functions

const std::string & getObserverType (void) const
 Todo. More...
 
void setObserverType (const std::string &observerType)
virtual bool isEnabled (void) const
 Todo. More...
 
bool _getOriginalEnabled (void) const
 Returns the 'enabled' value that was set in setEnabled() and not altered during execution. More...
 
virtual void setEnabled (bool enabled)
 Todo. More...
 
void _resetEnabled (void)
 Reset internal values for 'enabled'. More...
 
const std::string & getName (void) const
 Todo. More...
 
void setName (const std::string &name)
const PUParticle3D::ParticleTypegetParticleTypeToObserve (void) const
 Todo. More...
 
local getParticleTypeToObserve ()
 Todo. More...
 
void setParticleTypeToObserve (const PUParticle3D::ParticleType particleTypeToObserve)
virtual void notifyStart (void)
virtual void notifyStop (void)
virtual void notifyRescaled (const Vec3 &scale)
local notifyRescaled ( local scale)
virtual void preUpdateObserver (float deltaTime)
var preUpdateObserver ( var deltaTime)
local preUpdateObserver ( local deltaTime)
virtual void updateObserver (PUParticle3D *particle, float deltaTime, bool firstParticle)
local updateObserver ( local particle, local deltaTime, local firstParticle)
virtual void postUpdateObserver (float deltaTime)
virtual void firstParticleUpdate (PUParticle3D *particle, float deltaTime)
var firstParticleUpdate ( var particle, var deltaTime)
local firstParticleUpdate ( local particle, local deltaTime)
virtual bool observe (PUParticle3D *particle, float timeElapsed)=0
 This function determines whether a condition (the event) is true or false. More...
 
PUEventHandlercreateEventHandler (const std::string &eventHandlerType)
 Todo. More...
 
var createEventHandler ( var eventHandlerType)
 Todo. More...
 
local createEventHandler ( local eventHandlerType)
 Todo. More...
 
void addEventHandler (PUEventHandler *eventHandler)
 Todo. More...
 
void removeEventHandler (PUEventHandler *eventHandler)
 Todo. More...
 
PUEventHandlergetEventHandler (size_t index) const
 Todo. More...
 
var getEventHandler ( var index)
 Todo. More...
 
local getEventHandler ( local index)
 Todo. More...
 
PUEventHandlergetEventHandler (const std::string &eventHandlerName) const
 Todo. More...
 
size_t getNumEventHandlers (void) const
 Todo. More...
 
void destroyEventHandler (PUEventHandler *eventHandler)
 Todo. More...
 
void destroyEventHandler (size_t index)
 Todo. More...
 
void destroyAllEventHandlers (void)
 Todo. More...
 
float getObserverInterval (void) const
 Return the interval value, which defines at what interval the observer is called. More...
 
void setObserverInterval (float observerInterval)
 Set the interval value, which defines at what interval the observer is called. More...
 
bool getObserveUntilEvent (void) const
 Return the value of mObserveUntilEvent. More...
 
void setObserveUntilEvent (bool observeUntilEvent)
 Sets the value of mObserveUntilEvent. More...
 
bool isParticleTypeToObserveSet (void) const
 Returns true if the particle type to observe specifically has been set. More...
 
virtual void copyAttributesTo (PUObserver *observer)
var copyAttributesTo ( var observer)
local copyAttributesTo ( local observer)
virtual ~PUObserver (void)
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Refautorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor. More...
 

Public Attributes

CC_CONSTRUCTOR_ACCESS __pad0__: PUObserver(void)

Static Public Attributes

static const bool DEFAULT_ENABLED
var DEFAULT_ENABLED
local DEFAULT_ENABLED
static const
PUParticle3D::ParticleType 
DEFAULT_PARTICLE_TYPE
static const float DEFAULT_INTERVAL
static const bool DEFAULT_UNTIL_EVENT
var DEFAULT_UNTIL_EVENT
local DEFAULT_UNTIL_EVENT

Protected Member Functions

virtual void handleObserve (PUParticle3D *particle, float timeElapsed)
 Handle the observer implementation. More...
 
local handleObserve ( local particle, local timeElapsed)
 Handle the observer implementation. More...
 
virtual void handleEvent (PUParticle3D *particle, float timeElapsed)
 Handle the event. More...
 
var handleEvent ( var particle, var timeElapsed)
 Handle the event. More...
 
local handleEvent ( local particle, local timeElapsed)
 Handle the event. More...
 
- Protected Member Functions inherited from Ref
 Ref ()
 Constructor. More...
 
 Ref ()
 Constructor. More...
 

Protected Attributes

PUParticleSystem3D_particleSystem
std::string _observerType
std::string _name
bool _enabled
 Determines whether an observer is activated. More...
 
bool _originalEnabled
bool _originalEnabledSet
bool _observe
 Determines whether the _observe() function must be executed. More...
 
bool _observeUntilEvent
 Observes until an event takes place. More...
 
bool _eventHandlersExecuted
 Flag that is set if the event handler(s) are called at least once. More...
 
Vec3 _observerScale
 Although the scale is on a Particle System level, the observer can also be scaled. More...
 
PUParticle3D::ParticleType _particleTypeToObserve
local _particleTypeToObserve
bool _particleTypeToObserveSet
 Determines whether mParticleTypeToObserve is set. More...
 
ParticleEventHandlerList _eventHandlers
float _observerInterval
 Values that determine that the observer is called after every interval. More...
 
float _observerIntervalRemainder
bool _observerIntervalSet
- Protected Attributes inherited from Ref
unsigned int _referenceCount
 count of references More...
 
local _referenceCount
 count of references More...
 

Friends

class PUParticleSystem3D

Member Typedef Documentation

typedef std::vector
<PUEventHandler*>
::const_iterator
ParticleEventHandlerConstIterator
typedef std::vector
<PUEventHandler*>::iterator
ParticleEventHandlerIterator
typedef std::vector
<PUEventHandler*>
ParticleEventHandlerList

Constructor & Destructor Documentation

virtual ~PUObserver ( void  )
virtual
var ~PUObserver (   )
virtual
local ~PUObserver (   )
virtual

Member Function Documentation

bool _getOriginalEnabled ( void  ) const

Returns the 'enabled' value that was set in setEnabled() and not altered during execution.

var _getOriginalEnabled (   )

Returns the 'enabled' value that was set in setEnabled() and not altered during execution.

local _getOriginalEnabled (   )

Returns the 'enabled' value that was set in setEnabled() and not altered during execution.

void _resetEnabled ( void  )

Reset internal values for 'enabled'.

This means that both the mEnabled and mOriginalEnabled can be set again using setEnabled.

Remarks
Using _resetEnabled() makes it possible to use setEnabled() without the restriction of having a fixed mOriginalEnabled value.
var _resetEnabled (   )

Reset internal values for 'enabled'.

This means that both the mEnabled and mOriginalEnabled can be set again using setEnabled.

Remarks
Using _resetEnabled() makes it possible to use setEnabled() without the restriction of having a fixed mOriginalEnabled value.
local _resetEnabled (   )

Reset internal values for 'enabled'.

This means that both the mEnabled and mOriginalEnabled can be set again using setEnabled.

Remarks
Using _resetEnabled() makes it possible to use setEnabled() without the restriction of having a fixed mOriginalEnabled value.
void addEventHandler ( PUEventHandler eventHandler)

Todo.

var addEventHandler ( var  eventHandler)

Todo.

local addEventHandler ( local  eventHandler)

Todo.

virtual void copyAttributesTo ( PUObserver observer)
virtual
var copyAttributesTo ( var  observer)
virtual
local copyAttributesTo ( local  observer)
virtual
PUEventHandler* createEventHandler ( const std::string &  eventHandlerType)

Todo.

var createEventHandler ( var  eventHandlerType)

Todo.

local createEventHandler ( local  eventHandlerType)

Todo.

void destroyAllEventHandlers ( void  )

Todo.

var destroyAllEventHandlers (   )

Todo.

local destroyAllEventHandlers (   )

Todo.

void destroyEventHandler ( PUEventHandler eventHandler)

Todo.

var destroyEventHandler ( var  eventHandler)

Todo.

local destroyEventHandler ( local  eventHandler)

Todo.

void destroyEventHandler ( size_t  index)

Todo.

var destroyEventHandler ( var  index)

Todo.

local destroyEventHandler ( local  index)

Todo.

virtual void firstParticleUpdate ( PUParticle3D particle,
float  deltaTime 
)
virtual
var firstParticleUpdate ( var  particle,
var  deltaTime 
)
virtual
local firstParticleUpdate ( local  particle,
local  deltaTime 
)
virtual
PUEventHandler* getEventHandler ( size_t  index) const

Todo.

var getEventHandler ( var  index)

Todo.

local getEventHandler ( local  index)

Todo.

PUEventHandler* getEventHandler ( const std::string &  eventHandlerName) const

Todo.

var getEventHandler ( var  eventHandlerName)

Todo.

local getEventHandler ( local  eventHandlerName)

Todo.

const std::string& getName ( void  ) const
inline

Todo.

Todo

var getName (   )
inline

Todo.

Todo

local getName (   )
inline

Todo.

Todo

size_t getNumEventHandlers ( void  ) const

Todo.

var getNumEventHandlers (   )

Todo.

local getNumEventHandlers (   )

Todo.

float getObserverInterval ( void  ) const

Return the interval value, which defines at what interval the observer is called.

var getObserverInterval (   )

Return the interval value, which defines at what interval the observer is called.

local getObserverInterval (   )

Return the interval value, which defines at what interval the observer is called.

const std::string& getObserverType ( void  ) const
inline

Todo.

var getObserverType (   )
inline

Todo.

local getObserverType (   )
inline

Todo.

bool getObserveUntilEvent ( void  ) const

Return the value of mObserveUntilEvent.

var getObserveUntilEvent (   )

Return the value of mObserveUntilEvent.

local getObserveUntilEvent (   )

Return the value of mObserveUntilEvent.

const
PUParticle3D::ParticleType&
getParticleTypeToObserve
( void  ) const
inline

Todo.

var getParticleTypeToObserve (   )
inline

Todo.

local getParticleTypeToObserve (   )
inline

Todo.

virtual void handleEvent ( PUParticle3D particle,
float  timeElapsed 
)
protectedvirtual

Handle the event.

Remarks
This function iterates over all at the observer registered handlers and executes them.
var handleEvent ( var  particle,
var  timeElapsed 
)
protectedvirtual

Handle the event.

Remarks
This function iterates over all at the observer registered handlers and executes them.
local handleEvent ( local  particle,
local  timeElapsed 
)
protectedvirtual

Handle the event.

Remarks
This function iterates over all at the observer registered handlers and executes them.
virtual void handleObserve ( PUParticle3D particle,
float  timeElapsed 
)
protectedvirtual

Handle the observer implementation.

var handleObserve ( var  particle,
var  timeElapsed 
)
protectedvirtual

Handle the observer implementation.

local handleObserve ( local  particle,
local  timeElapsed 
)
protectedvirtual

Handle the observer implementation.

virtual bool isEnabled ( void  ) const
virtual

Todo.

var isEnabled (   )
virtual

Todo.

local isEnabled (   )
virtual

Todo.

bool isParticleTypeToObserveSet ( void  ) const

Returns true if the particle type to observe specifically has been set.

var isParticleTypeToObserveSet (   )

Returns true if the particle type to observe specifically has been set.

local isParticleTypeToObserveSet (   )

Returns true if the particle type to observe specifically has been set.

virtual void notifyRescaled ( const Vec3 scale)
virtual
var notifyRescaled ( var  scale)
virtual
local notifyRescaled ( local  scale)
virtual
virtual void notifyStart ( void  )
virtual

Reimplemented in PUOnCountObserver, and PUOnClearObserver.

var notifyStart (   )
virtual

Reimplemented in PUOnCountObserver, and PUOnClearObserver.

local notifyStart (   )
virtual

Reimplemented in PUOnCountObserver, and PUOnClearObserver.

virtual void notifyStop ( void  )
inlinevirtual
var notifyStop (   )
inlinevirtual
local notifyStop (   )
inlinevirtual
virtual bool observe ( PUParticle3D particle,
float  timeElapsed 
)
pure virtual
var observe ( var  particle,
var  timeElapsed 
)
pure virtual
local observe ( local  particle,
local  timeElapsed 
)
pure virtual
virtual void postUpdateObserver ( float  deltaTime)
virtual

Reimplemented in PUOnClearObserver, and PUOnQuotaObserver.

var postUpdateObserver ( var  deltaTime)
virtual

Reimplemented in PUOnClearObserver, and PUOnQuotaObserver.

local postUpdateObserver ( local  deltaTime)
virtual

Reimplemented in PUOnClearObserver, and PUOnQuotaObserver.

virtual void preUpdateObserver ( float  deltaTime)
virtual

Reimplemented in PUOnTimeObserver, and PUOnRandomObserver.

var preUpdateObserver ( var  deltaTime)
virtual

Reimplemented in PUOnTimeObserver, and PUOnRandomObserver.

local preUpdateObserver ( local  deltaTime)
virtual

Reimplemented in PUOnTimeObserver, and PUOnRandomObserver.

void removeEventHandler ( PUEventHandler eventHandler)

Todo.

var removeEventHandler ( var  eventHandler)

Todo.

local removeEventHandler ( local  eventHandler)

Todo.

virtual void setEnabled ( bool  enabled)
virtual

Todo.

var setEnabled ( var  enabled)
virtual

Todo.

local setEnabled ( local  enabled)
virtual

Todo.

void setName ( const std::string &  name)
inline
var setName ( var  name)
inline
local setName ( local  name)
inline
void setObserverInterval ( float  observerInterval)

Set the interval value, which defines at what interval the observer is called.

var setObserverInterval ( var  observerInterval)

Set the interval value, which defines at what interval the observer is called.

local setObserverInterval ( local  observerInterval)

Set the interval value, which defines at what interval the observer is called.

void setObserverType ( const std::string &  observerType)
inline
var setObserverType ( var  observerType)
inline
local setObserverType ( local  observerType)
inline
void setObserveUntilEvent ( bool  observeUntilEvent)

Sets the value of mObserveUntilEvent.

This value determines whether observation must be continued after an event ocurred and the event handlers are called.

var setObserveUntilEvent ( var  observeUntilEvent)

Sets the value of mObserveUntilEvent.

This value determines whether observation must be continued after an event ocurred and the event handlers are called.

local setObserveUntilEvent ( local  observeUntilEvent)

Sets the value of mObserveUntilEvent.

This value determines whether observation must be continued after an event ocurred and the event handlers are called.

void setParticleTypeToObserve ( const PUParticle3D::ParticleType  particleTypeToObserve)
var setParticleTypeToObserve ( var  particleTypeToObserve)
local setParticleTypeToObserve ( local  particleTypeToObserve)
virtual void updateObserver ( PUParticle3D particle,
float  deltaTime,
bool  firstParticle 
)
virtual

Reimplemented in PUOnClearObserver, and PUOnRandomObserver.

var updateObserver ( var  particle,
var  deltaTime,
var  firstParticle 
)
virtual

Reimplemented in PUOnClearObserver, and PUOnRandomObserver.

local updateObserver ( local  particle,
local  deltaTime,
local  firstParticle 
)
virtual

Reimplemented in PUOnClearObserver, and PUOnRandomObserver.

Friends And Related Function Documentation

friend class PUParticleSystem3D
friend
var PUParticleSystem3D
friend
local PUParticleSystem3D
friend

Member Data Documentation

var __pad0__
local __pad0__
bool _enabled
protected

Determines whether an observer is activated.

var _enabled
protected

Determines whether an observer is activated.

local _enabled
protected

Determines whether an observer is activated.

ParticleEventHandlerList
_eventHandlers
protected
var _eventHandlers
protected
local _eventHandlers
protected
bool _eventHandlersExecuted
protected

Flag that is set if the event handler(s) are called at least once.

var _eventHandlersExecuted
protected

Flag that is set if the event handler(s) are called at least once.

local _eventHandlersExecuted
protected

Flag that is set if the event handler(s) are called at least once.

std::string _name
protected
var _name
protected
local _name
protected
bool _observe
protected

Determines whether the _observe() function must be executed.

Remarks
This is independent of mEnabled, which means that an observer can be enabled, but if mObserve has been set to false, it still doesn't observe. It is used to enable/disable execution of the _observe() function in combination with the update interval.
var _observe
protected

Determines whether the _observe() function must be executed.

Remarks
This is independent of mEnabled, which means that an observer can be enabled, but if mObserve has been set to false, it still doesn't observe. It is used to enable/disable execution of the _observe() function in combination with the update interval.
local _observe
protected

Determines whether the _observe() function must be executed.

Remarks
This is independent of mEnabled, which means that an observer can be enabled, but if mObserve has been set to false, it still doesn't observe. It is used to enable/disable execution of the _observe() function in combination with the update interval.
float _observerInterval
protected

Values that determine that the observer is called after every interval.

var _observerInterval
protected

Values that determine that the observer is called after every interval.

local _observerInterval
protected

Values that determine that the observer is called after every interval.

float _observerIntervalRemainder
protected
var _observerIntervalRemainder
protected
local _observerIntervalRemainder
protected
bool _observerIntervalSet
protected
var _observerIntervalSet
protected
local _observerIntervalSet
protected
Vec3 _observerScale
protected

Although the scale is on a Particle System level, the observer can also be scaled.

var _observerScale
protected

Although the scale is on a Particle System level, the observer can also be scaled.

local _observerScale
protected

Although the scale is on a Particle System level, the observer can also be scaled.

std::string _observerType
protected
var _observerType
protected
local _observerType
protected
bool _observeUntilEvent
protected

Observes until an event takes place.

If the event occurs, the event handlers are called and after that the observer doesn't observe anymore.

var _observeUntilEvent
protected

Observes until an event takes place.

If the event occurs, the event handlers are called and after that the observer doesn't observe anymore.

local _observeUntilEvent
protected

Observes until an event takes place.

If the event occurs, the event handlers are called and after that the observer doesn't observe anymore.

bool _originalEnabled
protected
var _originalEnabled
protected
local _originalEnabled
protected
bool _originalEnabledSet
protected
var _originalEnabledSet
protected
local _originalEnabledSet
protected
PUParticleSystem3D* _particleSystem
protected
var _particleSystem
protected
local _particleSystem
protected
PUParticle3D::ParticleType
_particleTypeToObserve
protected
var _particleTypeToObserve
protected
local _particleTypeToObserve
protected
bool _particleTypeToObserveSet
protected

Determines whether mParticleTypeToObserve is set.

If ´true? only that particles of the specified type are observed. If ´false?(= default), all particles are observed.

var _particleTypeToObserveSet
protected

Determines whether mParticleTypeToObserve is set.

If ´true? only that particles of the specified type are observed. If ´false?(= default), all particles are observed.

local _particleTypeToObserveSet
protected

Determines whether mParticleTypeToObserve is set.

If ´true? only that particles of the specified type are observed. If ´false?(= default), all particles are observed.

const bool DEFAULT_ENABLED
static
var DEFAULT_ENABLED
static
local DEFAULT_ENABLED
static
const float DEFAULT_INTERVAL
static
var DEFAULT_INTERVAL
static
local DEFAULT_INTERVAL
static
const
PUParticle3D::ParticleType
DEFAULT_PARTICLE_TYPE
static
var DEFAULT_PARTICLE_TYPE
static
local DEFAULT_PARTICLE_TYPE
static
const bool DEFAULT_UNTIL_EVENT
static
var DEFAULT_UNTIL_EVENT
static
local DEFAULT_UNTIL_EVENT
static

The documentation for this class was generated from the following file: