Planeshift
Public Types | Public Member Functions | Public Attributes

psCreationManager Class Reference

Handles all the details of the character creation on the client side. More...

#include <psclientchar.h>

List of all members.

Public Types

typedef csPDelArray
< PathDefinition >::Iterator 
PathIterator
typedef csPDelArray< Trait >
::Iterator 
TraitIterator

Public Member Functions

void AddChoice (int choice, int modifier=1)
void AddLifeEvent (int event)
void ClearChoices ()
LifeEventChoiceFindLifeEvent (int idNumber)
void GenerateName (int type, csString &namebuffer, int max_low, int max_high)
void GetChildhoodData ()
CreationChoiceGetChoice (int id)
csArray< uint32_t > GetChoicesMade ()
int GetCost (int idChoice)
int GetCurrentCP ()
void GetCustomization (int &face, int &hairStyle, int &beardStyle, int &hairColour, int &skinColour)
 Gets the costumizations done and set with SetCostumization.
const char * GetDescription (int choiceID)
const char * GetFatherModAsText (void)
csArray< uint32_t > GetLifeChoices ()
int GetLifeCost (int id)
void GetLifeEventData ()
const char * GetLifeEventDescription (int id)
const char * GetModelName (int race, int gender)
 Gets the model file name for a race.
const char * GetMotherModAsText (void)
const char * GetName ()
size_t GetNumberOfLifeChoices ()
void GetParentData ()
 This requests the data needed to create the parent screen.
PathDefinitionGetPath (int i)
PathIterator GetPathIterator ()
RaceDefinitionGetRace (int race)
RaceDefinitionGetRace (const char *name)
int GetRaceCP (int race)
 Get the starting CP value for a race ( as defined in the enums ).
const char * GetRaceDescription (int race)
 Get a race desciption for a race.
int GetSelectedGender ()
int GetSelectedRace ()
TraitGetTrait (unsigned int uid)
void GetTraitData ()
TraitIterator GetTraitIterator ()
void HandleMessage (MsgEntry *me)
bool HasChildhoodData ()
bool HasLifeEventData ()
bool HasParentData ()
 returns true if the parent data is cached.
bool IsAvailable (int id, int gender)
 psCreationManager (iObjectRegistry *objectreg)
void RemoveChoice (uint32_t choice, int modifier=1)
void RemoveLifeEvent (uint32_t event)
void SetCurrentCP (int value)
void SetCustomization (int face, int hairStyle, int beardStyle, int hairColour, int skinColour)
void SetFatherMod (int mod)
void SetGender (int gender)
void SetMotherMod (int mod)
void SetName (const char *newName)
void SetPath (const char *name)
void SetRace (int selectedRace)
 Return the selected Race.
void UploadChar (bool doVerify=false)
virtual ~psCreationManager ()

Public Attributes

csArray< CreationChoicechildhoodData
 Holds data for the childhood data screen.
csArray< LifeEventChoicelifeEventData
csArray< CreationChoiceparentData
 A list of all the choices that are for the parent screen.

Detailed Description

Handles all the details of the character creation on the client side.

This class maintains the players choices, as well as the relevant information that is needed on the screens. This class communicates with the server to get any information that it needs to show the client. It caches this data as well so only new data needs to be requested from the server.

This class also sends the final 'create' message to the server once the creation has been complete on the client.

Definition at line 261 of file psclientchar.h.


Member Typedef Documentation

typedef csPDelArray<PathDefinition>::Iterator psCreationManager::PathIterator

Definition at line 291 of file psclientchar.h.

typedef csPDelArray<Trait>::Iterator psCreationManager::TraitIterator

Definition at line 296 of file psclientchar.h.


Constructor & Destructor Documentation

psCreationManager::psCreationManager ( iObjectRegistry *  objectreg)
virtual psCreationManager::~psCreationManager ( ) [virtual]

Member Function Documentation

void psCreationManager::AddChoice ( int  choice,
int  modifier = 1 
)
void psCreationManager::AddLifeEvent ( int  event)
void psCreationManager::ClearChoices ( )
LifeEventChoice* psCreationManager::FindLifeEvent ( int  idNumber)
void psCreationManager::GenerateName ( int  type,
csString &  namebuffer,
int  max_low,
int  max_high 
) [inline]

Definition at line 372 of file psclientchar.h.

void psCreationManager::GetChildhoodData ( )
CreationChoice* psCreationManager::GetChoice ( int  id)
csArray<uint32_t> psCreationManager::GetChoicesMade ( ) [inline]

Definition at line 352 of file psclientchar.h.

int psCreationManager::GetCost ( int  idChoice)
int psCreationManager::GetCurrentCP ( ) [inline]

Definition at line 334 of file psclientchar.h.

void psCreationManager::GetCustomization ( int face,
int hairStyle,
int beardStyle,
int hairColour,
int skinColour 
)

Gets the costumizations done and set with SetCostumization.

Parameters:
faceGives the trait uid of the face costumization done or zero if none.
hairStyleGives the trait uid of the hair style costumization done or zero if none.
beardStyleGives the trait uid of the beard style costumization done or zero if none.
hairColourGives the trait uid of the hair colour costumization done or zero if none.
skinColourGives the trait uid of the skin colour costumization done or zero if none.
const char* psCreationManager::GetDescription ( int  choiceID)
const char* psCreationManager::GetFatherModAsText ( void  ) [inline]

Definition at line 381 of file psclientchar.h.

csArray<uint32_t> psCreationManager::GetLifeChoices ( ) [inline]

Definition at line 356 of file psclientchar.h.

int psCreationManager::GetLifeCost ( int  id)
void psCreationManager::GetLifeEventData ( )
const char* psCreationManager::GetLifeEventDescription ( int  id)
const char* psCreationManager::GetModelName ( int  race,
int  gender 
)

Gets the model file name for a race.

Parameters:
raceOne of the 12 race model files
genderOne of the 3 genders.
Returns:
The string that is the name of the model file or NULL otherwise.
const char* psCreationManager::GetMotherModAsText ( void  ) [inline]

Definition at line 382 of file psclientchar.h.

const char* psCreationManager::GetName ( )
size_t psCreationManager::GetNumberOfLifeChoices ( ) [inline]

Definition at line 357 of file psclientchar.h.

void psCreationManager::GetParentData ( )

This requests the data needed to create the parent screen.

If the data is already on the client then does nothing.

PathDefinition* psCreationManager::GetPath ( int  i)
PathIterator psCreationManager::GetPathIterator ( )
RaceDefinition* psCreationManager::GetRace ( int  race)
RaceDefinition* psCreationManager::GetRace ( const char *  name)
int psCreationManager::GetRaceCP ( int  race)

Get the starting CP value for a race ( as defined in the enums ).

This information is requested from the server. If not yet ready it will return REQUESTING to let the caller know that it is not ready.

Parameters:
raceThe race id to get the CP value from.
Returns:
The CP value or REQUESTING
const char* psCreationManager::GetRaceDescription ( int  race)

Get a race desciption for a race.

This information is stored on the client in /data/races/descriptions.xml and should be available upon request ( ie no request to server ).

Parameters:
raceThe race ID to find the description of.
Returns:
The race description or "None" if race was not found.
int psCreationManager::GetSelectedGender ( ) [inline]

Definition at line 342 of file psclientchar.h.

int psCreationManager::GetSelectedRace ( ) [inline]

Definition at line 339 of file psclientchar.h.

Trait* psCreationManager::GetTrait ( unsigned int  uid)
void psCreationManager::GetTraitData ( )
TraitIterator psCreationManager::GetTraitIterator ( ) [inline]

Definition at line 297 of file psclientchar.h.

void psCreationManager::HandleMessage ( MsgEntry me) [virtual]

Implements psClientNetSubscriber.

bool psCreationManager::HasChildhoodData ( ) [inline]

Definition at line 311 of file psclientchar.h.

bool psCreationManager::HasLifeEventData ( ) [inline]

Definition at line 312 of file psclientchar.h.

bool psCreationManager::HasParentData ( ) [inline]

returns true if the parent data is cached.

Definition at line 310 of file psclientchar.h.

bool psCreationManager::IsAvailable ( int  id,
int  gender 
)
void psCreationManager::RemoveChoice ( uint32_t  choice,
int  modifier = 1 
)
void psCreationManager::RemoveLifeEvent ( uint32_t  event)
void psCreationManager::SetCurrentCP ( int  value) [inline]

Definition at line 335 of file psclientchar.h.

void psCreationManager::SetCustomization ( int  face,
int  hairStyle,
int  beardStyle,
int  hairColour,
int  skinColour 
)
void psCreationManager::SetFatherMod ( int  mod) [inline]

Definition at line 379 of file psclientchar.h.

void psCreationManager::SetGender ( int  gender) [inline]

Definition at line 341 of file psclientchar.h.

void psCreationManager::SetMotherMod ( int  mod) [inline]

Definition at line 380 of file psclientchar.h.

void psCreationManager::SetName ( const char *  newName)
void psCreationManager::SetPath ( const char *  name) [inline]

Definition at line 385 of file psclientchar.h.

void psCreationManager::SetRace ( int  selectedRace)

Return the selected Race.

void psCreationManager::UploadChar ( bool  doVerify = false)

Member Data Documentation

Holds data for the childhood data screen.

Definition at line 327 of file psclientchar.h.

Definition at line 330 of file psclientchar.h.

A list of all the choices that are for the parent screen.

Definition at line 324 of file psclientchar.h.


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