Emergency 20 Dokumentation  4.2.0
em5::ReserveLogic Class Reference

Reserve logic. More...

#include <ReserveLogic.h>

Inheritance diagram for em5::ReserveLogic:
qsf::GameLogic qsf::WeakPtrTarget em5::RescueWitchLogic em5::ReserveArrestGangsterLogic em5::ReserveAttackedByGangsterLogic em5::ReserveCloseCombatLogic em5::ReserveCutRoadVehicleLogic em5::ReserveCutTreeLogic em5::ReserveDecontaminatePersonLogic em5::ReserveDivingSpotLogic em5::ReserveDLKRescueLogic em5::ReserveDoctorLogic em5::ReserveEnterVehicleLogic em5::ReserveGangsterLogic em5::ReserveGuidePersonLogic em5::ReserveHeavyCraneLogic em5::ReserveMoveToTargetLogic em5::ReserveParamedicLogic em5::ReservePullingLogic em5::ReserveRabidDogLogic em5::ReserveRepairOrUseLogic em5::ReserveRescueDogLogic em5::ReserveTowcarLogic em5::ReserveWaitForFinishLogic em5::SpeakToPersonLogic

Public Types

enum  ReservePriority { STANDARD = 100, LOW = 50, MOVETO = 10, NO_UNIT = 5 }
 

Public Member Functions

 ReserveLogic (uint32 gamelogicTypeId)
 
uint64 getReservationId ()
 
void setReservationId (uint64 reservationId)
 
void deleteLogic ()
 
- 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...
 
virtual bool onStartup ()
 Startup the game logic. More...
 
virtual void onShutdown ()
 Shutdown the game logic. More...
 
virtual void serialize (BinarySerializer &serializer)
 Serialize or deserialize the game logic using a binary serializer. More...
 

Static Public Member Functions

template<typename T >
static void createReservation (qsf::Entity &targetEntity, uint64 reservationId)
 Create the given reservation type at the target and set the reservation ID. More...
 
static bool checkReservation (qsf::Entity &targetEntity, uint64 reservationId, ReservePriority priority=ReservePriority::STANDARD)
 Check if entity has an reservation and if it reserve the given id. More...
 
static void deleteOwnReservation (qsf::Entity &targetEntity, uint64 reservationId)
 Checks if the target reservation logic matches the given reservation id, in case "false" delete the reservation logic of the target entity. More...
 
static void deleteOwnReservation (const qsf::WeakPtr< qsf::Entity > &targetEntity, uint64 reservationId)
 Checks if the target reservation logic matches the given reservation id, in case "false" delete the reservation logic of the target entity. More...
 
static void deleteOwnReservation (qsf::Map &map, uint64 targetEntityId, uint64 reservationId)
 Checks if the target reservation logic matches the given reservation id, in case "false" delete the reservation logic of the target entity. More...
 
static void createReservationByTypeId (qsf::Entity &targetEntity, uint64 reservationId, uint32 typeId)
 

Static Public Attributes

static const uint32 GAMELOGIC_TYPE_ID
 

Protected Attributes

uint64 mReservationId
 ID of the entity who reserved this. More...
 
ReservePriority mReservePriority
 

Additional Inherited Members

- 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

Reserve logic.

Member Enumeration Documentation

Enumerator
STANDARD 

Almost all reservations have this level.

LOW 
MOVETO 

Reservate but on the way to target, no interacting happens yet.

NO_UNIT 

Reservation from a non unit.

Constructor & Destructor Documentation

em5::ReserveLogic::ReserveLogic ( uint32  gamelogicTypeId)
explicit

Member Function Documentation

static bool em5::ReserveLogic::checkReservation ( qsf::Entity targetEntity,
uint64  reservationId,
ReservePriority  priority = ReservePriority::STANDARD 
)
static

Check if entity has an reservation and if it reserve the given id.

Returns
"true" if no reservation is active or the current reservation is the given id
template<typename T >
void em5::ReserveLogic::createReservation ( qsf::Entity targetEntity,
uint64  reservationId 
)
static

Create the given reservation type at the target and set the reservation ID.

static void em5::ReserveLogic::createReservationByTypeId ( qsf::Entity targetEntity,
uint64  reservationId,
uint32  typeId 
)
static
void em5::ReserveLogic::deleteLogic ( )
static void em5::ReserveLogic::deleteOwnReservation ( qsf::Entity targetEntity,
uint64  reservationId 
)
static

Checks if the target reservation logic matches the given reservation id, in case "false" delete the reservation logic of the target entity.

static void em5::ReserveLogic::deleteOwnReservation ( const qsf::WeakPtr< qsf::Entity > &  targetEntity,
uint64  reservationId 
)
static

Checks if the target reservation logic matches the given reservation id, in case "false" delete the reservation logic of the target entity.

static void em5::ReserveLogic::deleteOwnReservation ( qsf::Map map,
uint64  targetEntityId,
uint64  reservationId 
)
static

Checks if the target reservation logic matches the given reservation id, in case "false" delete the reservation logic of the target entity.

uint64 em5::ReserveLogic::getReservationId ( )
void em5::ReserveLogic::setReservationId ( uint64  reservationId)

Member Data Documentation

const uint32 em5::ReserveLogic::GAMELOGIC_TYPE_ID
static
uint64 em5::ReserveLogic::mReservationId
protected

ID of the entity who reserved this.

ReservePriority em5::ReserveLogic::mReservePriority
protected

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