character_base Class Reference

Base character class containing attributes and dialog stuff. More...

#include <character_base.h>

Inheritance diagram for character_base:

Inheritance graph
[legend]
Collaboration diagram for character_base:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 character_base ()
 Default constructor.
 ~character_base ()
 Destructor.
string get_name () const
 Returns the name of the character.
string get_id ()
 Returns an unique identifier of the character.
void set_name (string newname)
 Sets the name of the character.
u_int32 get_color () const
 Returns the color representing the character.
void set_color (int c)
 Sets the color representing the character.
string get_portrait () const
 Returns the current portrait of the character.
void set_portrait (string fname)
 Sets the current portrait of the character.
string get_dialogue () const
 Return the file name of the current character's dialog.
void set_dialogue (string dialogue)
 Sets the dialogue of the character.
void get_state (igzstream &in)
 Loads the state (attributes) of the character from an opened file.
void put_state (ogzstream &out)
 Saves the state (ttributes) of the character into an opened file.


Detailed Description

Base character class containing attributes and dialog stuff.

Definition at line 77 of file character_base.h.


Constructor & Destructor Documentation

character_base::character_base (  ) 

Default constructor.

Definition at line 32 of file character_base.cc.

character_base::~character_base (  ) 

Destructor.

Definition at line 42 of file character_base.cc.


Member Function Documentation

string character_base::get_name (  )  const [inline]

Returns the name of the character.

Returns:
the name of the character.

Definition at line 97 of file character_base.h.

string character_base::get_id (  )  [inline]

Returns an unique identifier of the character.

Returns:
  • Player for the player controlled character
  • the character's name otherwise.

Definition at line 106 of file character_base.h.

void character_base::set_name ( string  newname  ) 

Sets the name of the character.

Parameters:
newname name of the character.

Definition at line 46 of file character_base.cc.

u_int32 character_base::get_color (  )  const [inline]

Returns the color representing the character.

Returns:
the color representing the character.

Definition at line 124 of file character_base.h.

void character_base::set_color ( int  c  )  [inline]

Sets the color representing the character.

Parameters:
c new color representing the character.

Definition at line 131 of file character_base.h.

string character_base::get_portrait (  )  const [inline]

Returns the current portrait of the character.

Returns:
the current portrait of the character.

Definition at line 138 of file character_base.h.

void character_base::set_portrait ( string  fname  )  [inline]

Sets the current portrait of the character.

Parameters:
fname filename of the new portrait to use.

Definition at line 145 of file character_base.h.

string character_base::get_dialogue (  )  const [inline]

Return the file name of the current character's dialog.

Returns:
file name of the dialog currently assigned to this character.

Definition at line 152 of file character_base.h.

void character_base::set_dialogue ( string  dialogue  ) 

Sets the dialogue of the character.

Parameters:
dialogue new character's dialog.

Definition at line 51 of file character_base.cc.

void character_base::get_state ( igzstream in  ) 

Loads the state (attributes) of the character from an opened file.

Parameters:
in file from which to read.

Bug:
: We should be able to pass a string to objects instead of a char *, which memory isn't freed at exit.

Reimplemented in mapcharacter.

Definition at line 83 of file character_base.cc.

void character_base::put_state ( ogzstream out  ) 

Saves the state (ttributes) of the character into an opened file.

Parameters:
out file where to save.

Definition at line 56 of file character_base.cc.


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

Generated on Wed Jun 18 16:23:53 2008 for Adonthell by  doxygen 1.5.6