Emergency 2017 Dokumentation  v3.0.1
em5::Cleanup Class Reference

Cleanup base class. More...

#include <Cleanup.h>

Public Types

enum  CleanupResult { RESULT_OK, RESULT_FAILED, RESULT_RESETTIMER }
 
enum  ExecuteResult { EXECUTE_OK, EXECUTE_DELETEOWNER }
 

Public Member Functions

void executeCleanup ()
 Clean up the entity. More...
 
virtual bool onStartup () override
 Startup the game logic. More...
 
virtual void onShutdown () override
 Shutdown the game logic. More...
 
virtual void serialize (qsf::BinarySerializer &serializer) override
 Serialize or deserialize the game logic using a binary serializer. More...
 
- Public Member Functions inherited from qsf::GameLogic
virtual ~GameLogic ()
 Destructor. More...
 
uint32 getId () const
 Get the game logic's unique ID. More...
 
uint32 getTypeId () const
 Get the game logic's type ID. More...
 
uint64 getEntityId () const
 Get the owning entity's ID or zero if there is none. More...
 
EntitygetEntity () const
 Get the owning entity or a null pointer if there is none. More...
 
EntitygetEntitySafe () const
 Get the owning entity or a null pointer if there is none. More...
 
MapgetMap () const
 Get the associated map of the game logic. More...
 
bool startup ()
 Startup the game logic. More...
 
bool isRunning () const
 Return whether or not the game logic is up-and-running. More...
 
void shutdown ()
 Shutdown the game logic. More...
 
bool isDebug () const
 Return whether or not the logic is considered to be in debug mode. More...
 
void setDebug (bool debugMode)
 Set whether or not the logic is considered to be in debug mode. More...
 

Protected Member Functions

 Cleanup (uint32 typeId, const qsf::Time &startWaitTime=qsf::Time::fromSeconds(300.0f), const qsf::Time &resetWaitTime=qsf::Time::fromSeconds(20.0f))
 Constructor with default values. More...
 
virtual CleanupResult readyForCleanupCheap () const
 Check if the cleanup can be done cheap. More...
 
virtual CleanupResult onReadyForCleanupCheap () const
 React to the ready for cleanup cheap. More...
 
virtual CleanupResult readyForCleanupExpensive () const
 Check if the cleanup can be done expensive. More...
 
virtual CleanupResult onReadyForCleanupExpensive () const
 React to the ready for cleanup expansive. More...
 
virtual ExecuteResult onExecuteCleanup ()
 React to execute cleanup method. More...
 
- Protected Member Functions inherited from qsf::GameLogic
virtual void onSetDebug (bool debug)
 Set whether or not the logic is considered to be in debug mode. More...
 
void removeThis ()
 
 GameLogic (uint32 typeId)
 Constructor. More...
 
void registrationAtManager (GameLogicManager &manager, uint32 id)
 Registering call from manager. More...
 
- Protected Member Functions inherited from qsf::WeakPtrTarget
 WeakPtrTarget ()
 Default constructor. More...
 
 WeakPtrTarget (const WeakPtrTarget &other)
 Copy constructor. More...
 
 WeakPtrTarget (WeakPtrTarget &&)=delete
 Delete the move constructor, as WeakPtrTarget would need a proper move constructor-implementation that ensures that its pointer gets updated in the WeakPtrBase as well. More...
 
 ~WeakPtrTarget ()
 Destructor. More...
 
void invalidateAllWeakPtr ()
 Invalidate all weak pointers to this object. More...
 
void operator= (const WeakPtrTarget &other)
 Copy operator. More...
 

Detailed Description

Cleanup base class.

Note
  • After this logic was created it waits for a defined time value until it checks if the entity must be cleaned up
  • If the cheap check or the expensive check return the reset timer result, the logic waits a defined amount of time until it starts checking again

Definition at line 37 of file Cleanup.h.

Member Enumeration Documentation

Enumerator
RESULT_OK 
RESULT_FAILED 
RESULT_RESETTIMER 

Definition at line 45 of file Cleanup.h.

Enumerator
EXECUTE_OK 
EXECUTE_DELETEOWNER 

Definition at line 52 of file Cleanup.h.

Constructor & Destructor Documentation

em5::Cleanup::Cleanup ( uint32  typeId,
const qsf::Time startWaitTime = qsf::Time::fromSeconds(300.0f),
const qsf::Time resetWaitTime = qsf::Time::fromSeconds(20.0f) 
)
explicitprotected

Constructor with default values.

Member Function Documentation

void em5::Cleanup::executeCleanup ( )

Clean up the entity.

virtual ExecuteResult em5::Cleanup::onExecuteCleanup ( )
protectedvirtual
virtual CleanupResult em5::Cleanup::onReadyForCleanupCheap ( ) const
protectedvirtual
virtual CleanupResult em5::Cleanup::onReadyForCleanupExpensive ( ) const
protectedvirtual

React to the ready for cleanup expansive.

virtual void em5::Cleanup::onShutdown ( )
overridevirtual

Shutdown the game logic.

Reimplemented from qsf::GameLogic.

Reimplemented in em5::ParkingVehicleCleanup.

virtual bool em5::Cleanup::onStartup ( )
overridevirtual

Startup the game logic.

Reimplemented from qsf::GameLogic.

Reimplemented in em5::ParkingVehicleCleanup.

virtual CleanupResult em5::Cleanup::readyForCleanupCheap ( ) const
protectedvirtual

Check if the cleanup can be done cheap.

Reimplemented in em5::LayerCleanup.

virtual CleanupResult em5::Cleanup::readyForCleanupExpensive ( ) const
protectedvirtual

Check if the cleanup can be done expensive.

virtual void em5::Cleanup::serialize ( qsf::BinarySerializer serializer)
overridevirtual

Serialize or deserialize the game logic using a binary serializer.

Parameters
[in]serializerThe serializer, which can be either in read or write mode

Reimplemented from qsf::GameLogic.


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