Planeshift
HireSession Class Reference

The Hire Sessin will manage all aspects related to a specefic hiring of a NPC. More...

#include <hiresession.h>

Public Member Functions

int ApplyScript ()
 Apply the script to the server. More...
 
bool Delete ()
 Delete from db. More...
 
gemNPCGetHiredNPC () const
 Get hired NPC. More...
 
PID GetHiredPID ()
 Return the PID of the hired NPC. More...
 
const csString & GetHireTypeName () const
 Get hire type. More...
 
const csString & GetHireTypeNPCType () const
 Get hire type. More...
 
PID GetMasterPID () const
 Get Master PID. More...
 
gemActorGetOwner () const
 Get owner. More...
 
PID GetOwnerPID ()
 Return the PID of the owner. More...
 
const csString & GetScript () const
 Return the hired NPC script. More...
 
LocationGetTempWorkLocation ()
 Get work postion. More...
 
csString GetTempWorkLocationString ()
 Get work postion string. More...
 
bool GetTempWorkLocationValid ()
 Get validity of temp work postion. More...
 
const csString & GetVerifiedScript () const
 Return the verified hired NPC script. More...
 
LocationGetWorkLocation ()
 Get work postion. More...
 
int GetWorkLocationId ()
 Get work postion. More...
 
csString GetWorkLocationString ()
 Get work locaiton string. More...
 
 HireSession ()
 Constructor. More...
 
 HireSession (gemActor *owner)
 Constructor. More...
 
bool IsVerified ()
 Check if the script is verified. More...
 
bool Load (iResultRow &row)
 Load from db. More...
 
bool Save (bool newSession=false)
 Save to db. More...
 
void SetHiredNPC (gemNPC *hiredNPC)
 Set hired NPC. More...
 
void SetHireType (const csString &name, const csString &npcType)
 Set pending hire type. More...
 
void SetMasterPID (PID masterPID)
 Set pending hire master NPC PID. More...
 
void SetOwner (gemActor *owner)
 Set owner. More...
 
void SetScript (const csString &newScript)
 Set the hired NPC script. More...
 
void SetTempWorkLocation (Location *location)
 Set a new working location. More...
 
void SetTempWorkLocationValid (bool valid)
 Set validity of temp work postion. More...
 
void SetVerified (bool state)
 Set verified. More...
 
void SetVerifiedScript (const csString &newVerifiedScript)
 Save a verified script. More...
 
void SetWorkLocation (Location *location)
 Set a new working location. More...
 
bool ShouldLoad ()
 Indicate if script should be loaded upon hired npc attach after first load. More...
 
bool VerifyPendingHireConfigured ()
 Verify if all requirments for hire is ok. More...
 
virtual ~HireSession ()
 Destructor. More...
 

Detailed Description

The Hire Sessin will manage all aspects related to a specefic hiring of a NPC.

Players is allowed to Hire NPCs to do tasks for them. This can include selling of items, standing guard for the guild, etc. This session handle the details for the hire session. The main business logic for hiring is managed by the HireManager.

Definition at line 45 of file hiresession.h.

Constructor & Destructor Documentation

HireSession::HireSession ( )

Constructor.

HireSession::HireSession ( gemActor owner)

Constructor.

Parameters
ownerThe player that start to hire a NPCs.
virtual HireSession::~HireSession ( )
virtual

Destructor.

Member Function Documentation

int HireSession::ApplyScript ( )

Apply the script to the server.

bool HireSession::Delete ( )

Delete from db.

gemNPC* HireSession::GetHiredNPC ( ) const

Get hired NPC.

PID HireSession::GetHiredPID ( )

Return the PID of the hired NPC.

Returns
PID of the hired NPC.
const csString& HireSession::GetHireTypeName ( ) const

Get hire type.

Returns
The NPC Type of the NPC type to hire type.
const csString& HireSession::GetHireTypeNPCType ( ) const

Get hire type.

Returns
The NPC Type of the NPC type to hire type.
PID HireSession::GetMasterPID ( ) const

Get Master PID.

Returns
The Master PID.
gemActor* HireSession::GetOwner ( ) const

Get owner.

PID HireSession::GetOwnerPID ( )

Return the PID of the owner.

Returns
PID of the owner.
const csString& HireSession::GetScript ( ) const

Return the hired NPC script.

Location* HireSession::GetTempWorkLocation ( )

Get work postion.

csString HireSession::GetTempWorkLocationString ( )

Get work postion string.

bool HireSession::GetTempWorkLocationValid ( )

Get validity of temp work postion.

const csString& HireSession::GetVerifiedScript ( ) const

Return the verified hired NPC script.

Location* HireSession::GetWorkLocation ( )

Get work postion.

int HireSession::GetWorkLocationId ( )

Get work postion.

csString HireSession::GetWorkLocationString ( )

Get work locaiton string.

bool HireSession::IsVerified ( )

Check if the script is verified.

bool HireSession::Load ( iResultRow &  row)

Load from db.

bool HireSession::Save ( bool  newSession = false)

Save to db.

Parameters
newSessionSet to true if this is a new session.
void HireSession::SetHiredNPC ( gemNPC hiredNPC)

Set hired NPC.

Parameters
hiredNPCThe hired NPC.
void HireSession::SetHireType ( const csString &  name,
const csString &  npcType 
)

Set pending hire type.

Parameters
nameThe name of the NPC type to hire.
npcTypeThe NPC Type of the NPC type to hire type.
void HireSession::SetMasterPID ( PID  masterPID)

Set pending hire master NPC PID.

Parameters
masterPIDThe PID of the master NPC.
void HireSession::SetOwner ( gemActor owner)

Set owner.

Parameters
ownerThe hired NPC owner.
void HireSession::SetScript ( const csString &  newScript)

Set the hired NPC script.

void HireSession::SetTempWorkLocation ( Location location)

Set a new working location.

void HireSession::SetTempWorkLocationValid ( bool  valid)

Set validity of temp work postion.

void HireSession::SetVerified ( bool  state)

Set verified.

void HireSession::SetVerifiedScript ( const csString &  newVerifiedScript)

Save a verified script.

void HireSession::SetWorkLocation ( Location location)

Set a new working location.

bool HireSession::ShouldLoad ( )

Indicate if script should be loaded upon hired npc attach after first load.

bool HireSession::VerifyPendingHireConfigured ( )

Verify if all requirments for hire is ok.

Returns
True if ok to confirm hire.

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