Planeshift
Public Member Functions

HireSession Class Reference

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

#include <hiresession.h>

List of all members.

Public Member Functions

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

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: