Planeshift
Public Member Functions

HireManager Class Reference

The Hire Manager will manage all aspects related to hiring of NPCs. More...

#include <hiremanager.h>

List of all members.

Public Member Functions

bool AddHiredNPC (gemNPC *hiredNPC)
 Register a hired NPC with the hire manager.
bool AddOwner (gemActor *owner)
 Register an owner with the hire manager.
bool CheckWorkLocationResult (gemNPC *hiredNPC, bool valid, const char *errorMessage)
 Result from work location check.
gemActorConfirmHire (gemActor *owner)
 Confirm the hire.
bool HandleScriptMessageRequest (uint32_t clientnum, gemActor *owner, gemNPC *hiredNPC)
 Start Scripting the hire.
 HireManager ()
 Constructor.
bool Initialize ()
 Initialize the Hire Manager.
bool ReleaseHire (gemActor *owner, gemNPC *hiredNPC)
 Release the hire.
bool SetHireMasterPID (gemActor *owner, PID masterPID)
 Set the PID of the master NPC to use when hiring for a pending hire.
bool SetHireType (gemActor *owner, const csString &name, const csString &npcType)
 Set the type of NPC to hire for a pending hire.
bool StartHire (gemActor *owner)
 Start a new Hire Session.
virtual ~HireManager ()
 Destructor.

Detailed Description

The Hire Manager will manage all aspects related to hiring of NPCs.

Players is allowed to Hire NPCs to do tasks for them. This can include selling of items, standing guard for the guild, etc. This manager handle the business logic related to this. For each hire a HireSession object is created to manage the details of each hire.

Definition at line 49 of file hiremanager.h.


Constructor & Destructor Documentation

HireManager::HireManager ( )

Constructor.

virtual HireManager::~HireManager ( ) [virtual]

Destructor.


Member Function Documentation

bool HireManager::AddHiredNPC ( gemNPC hiredNPC)

Register a hired NPC with the hire manager.

bool HireManager::AddOwner ( gemActor owner)

Register an owner with the hire manager.

bool HireManager::CheckWorkLocationResult ( gemNPC hiredNPC,
bool  valid,
const char *  errorMessage 
)

Result from work location check.

gemActor* HireManager::ConfirmHire ( gemActor owner)

Confirm the hire.

The Hired NPC will be created and given to player.

bool HireManager::HandleScriptMessageRequest ( uint32_t  clientnum,
gemActor owner,
gemNPC hiredNPC 
)

Start Scripting the hire.

Start scripting of a NPC. This will open the scripting dialog for the NPC.

Parameters:
clientnumThe client ID that request scripting.
ownerThe actor that has hired the NPC.
hiredNPCThe NPC that is to be released from hire.
Returns:
True if scripting is allowed.
bool HireManager::Initialize ( )

Initialize the Hire Manager.

Handle all initialization that can go wrong.

Returns:
True if load suceeded. False if error is fatale and server should not start.
bool HireManager::ReleaseHire ( gemActor owner,
gemNPC hiredNPC 
)

Release the hire.

Release a NPC from hire if the hiredNPC is hired by the owner. The hired NPC will be deleted.

Parameters:
ownerThe actor that has hired the NPC.
hiredNPCThe NPC that is to be released from hire.
Returns:
True if the NPC was released.
bool HireManager::SetHireMasterPID ( gemActor owner,
PID  masterPID 
)

Set the PID of the master NPC to use when hiring for a pending hire.

Parameters:
ownerAn actor that is in progress of hiring.
masterNPCThe master NPC PID.
bool HireManager::SetHireType ( gemActor owner,
const csString &  name,
const csString &  npcType 
)

Set the type of NPC to hire for a pending hire.

Parameters:
ownerAn actor that is in progress of hiring.
nameThe name of the type of NPC to hire.
npcTypeThe NPC Type of the type of NPC to hire.
Returns:
True if the type was set for a pending hire.
bool HireManager::StartHire ( gemActor owner)

Start a new Hire Session.

Establish the hire session for modification in the hiring process.

Parameters:
ownerThe actor that start the process of hiring a NPC.
Returns:
True if actor was allowed to start a new hire process.

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