Adonthell  0.4
character Class Reference

Class holding game characters. More...

#include <character.h>

Inheritance diagram for character:
Collaboration diagram for character:

Public Member Functions

 character ()
 Default constructor. More...
 
 ~character ()
 Destructor. More...
 
- Public Member Functions inherited from mapcharacter
 mapcharacter ()
 Default constructor. More...
 
 ~mapcharacter ()
 Destructor. More...
 
void clear ()
 Puts the mapcharacter back to it's post-constructor state. More...
 
string filename () const
 Returns the current file name of the mapcharacter. More...
 
bool update ()
 Updates the mapcharacter's state and launchs his schedule. More...
 
void draw (s_int16 x, s_int16 y, const drawing_area *da_opt=NULL, surface *target=NULL) const
 Draw the object on the screen. More...
 
void draw_bubble (s_int16 x, s_int16 y, const drawing_area *da_opt=NULL, surface *target=NULL) const
 
s_int8 get (igzstream &file)
 Loads a mapcharacter from an opened file. More...
 
s_int8 load (string fname)
 Loads a mapcharacter from it's filename. More...
 
s_int8 put (ogzstream &file) const
 Saves an mapcharacter into an opened file, in game format, with alpha and mask values. More...
 
s_int8 save (string fname) const
 Saves an mapcharacter into an file, in game format, with alpha and mask values. More...
 
s_int8 get_state (igzstream &file)
 Restore the mapcharacter's state from an opened file. More...
 
s_int8 put_state (ogzstream &file) const
 Saves the mapcharacter's state into an opened file. More...
 
void set_map (landmap *m)
 Puts the mapcharacter on a landmap. More...
 
void remove_from_map ()
 Removes the mapcharacter from the landmap he was on (if any). More...
 
landmapmymap () const
 Returns a pointer to the landmap the mapcharacter is on. More...
 
void stand_north ()
 Look to North. More...
 
void stand_south ()
 Look to South. More...
 
void stand_east ()
 Look to East. More...
 
void stand_west ()
 Look to West. More...
 
void stand ()
 Stand to the current direction. More...
 
bool go_north ()
 Walk to North (if possible). More...
 
bool go_south ()
 Walk to South (if possible). More...
 
bool go_east ()
 Walk to East (if possible). More...
 
bool go_west ()
 Walk to West (if possible). More...
 
bool can_go_north () const
 Returns whether it is possible or not to go to North from the current mapcharacter's position. More...
 
bool can_go_south () const
 Returns whether it is possible or not to go to South from the current mapcharacter's position. More...
 
bool can_go_east () const
 Returns whether it is possible or not to go to East from the current mapcharacter's position. More...
 
bool can_go_west () const
 Returns whether it is possible or not to go to West from the current mapcharacter's position. More...
 
void look_invert (u_int16 p)
 Look at the opposite position of p. More...
 
mapcharacterwhosnext () const
 Return a pointer to the mapcharacter that is right next to this mapcharacter, i.e the mapcharacter that is on the square this mapcharacter is looking at. More...
 
void speak (const string &text)
 
bool is_speaking ()
 
text_bubbleget_bubble ()
 
void set_offset (s_int8 x, s_int8 y)
 Sets the offset of the mapcharacter on it's current mapsquare. More...
 
void remove_from_pos ()
 Removes the mapcharacter from the place he was on the map. More...
 
void jump_to (u_int16 smap, u_int16 x, u_int16 y, u_int16 pos=NO_MOVE)
 Remove the mapcharacter from it's current place and put him to a new one. More...
 
u_int16 submap () const
 Returns the index of the submap where the mapcharacter is. More...
 
u_int16 posx () const
 Returns the X position of the mapcharacter. More...
 
u_int16 posy () const
 Returns the Y position of the mapcharacter. More...
 
s_int8 offx () const
 Returns the X offset of the mapcharacter. More...
 
s_int8 offy () const
 Returns the Y offset of the mapcharacter. More...
 
u_int16 currentmove () const
 Returns the current move of the mapcharacter. More...
 
bool set_goal (u_int16 x, u_int16 y, u_int16 dir=NO_MOVE)
 
void set_callback (PyObject *callback, PyObject *args=NULL)
 
bool follow_path ()
 
bool goal_reached ()
 
void stop_moving ()
 
void time_callback (string delay, PyObject *cb, PyObject *args=NULL)
 
void time_callback_string (string delay, string cb, PyObject *args=NULL)
 
void set_schedule (string file, PyObject *args=NULL)
 Schedule control. More...
 
string schedule_file () const
 Returns the name of the mapcharacter's current schedule. More...
 
bool is_schedule_activated () const
 Returns whether the schedule is activated or not. More...
 
void set_schedule_active (bool a)
 Sets whether the schedule is active or not. More...
 
bool do_stuff (string method, PyObject *args=NULL)
 Tell the character to do something. More...
 
void set_action (string file, PyObject *args=NULL)
 Action control. More...
 
string action_file () const
 Returns the name of the mapcharacter's current action. More...
 
bool is_action_activated () const
 Returns whether the action is activated or not. More...
 
void set_action_active (bool a)
 Sets whether the action is active or not. More...
 
void launch_action (mapcharacter *requester)
 Run the mapcharacter's action, passing requester as the "requester" parameter for the action's Python script. More...
 
animationget_animation (u_int16 nbr)
 Returns a pointer to an animation corresponding to a movment. More...
 
mapcharacteroperator= (const mapcharacter &m)
 Mapcharacter copy (similar to copy ()). More...
 
void copy (const mapcharacter &src)
 Synonym of operator = to guarantee its access from Python. More...
 
- Public Member Functions inherited from mapsquare_walkable_area
 mapsquare_walkable_area ()
 Default constructor. More...
 
 ~mapsquare_walkable_area ()
 Destructor. More...
 
void clear ()
 Totally clears the area. More...
 
u_int16 area_length () const
 Returns the length of the area. More...
 
u_int16 area_height () const
 Returns the height of the area. More...
 
mapsquare_walkableget_square (u_int16 x, u_int16 y) const
 Returns a pointer to a desired square. More...
 
void resize_area (u_int16 nl, u_int16 nh)
 Resize the area. More...
 
u_int16 base_x () const
 Returns the X offset of the base square of this object. More...
 
u_int16 base_y () const
 Returns the Y offset of the base square of this object. More...
 
void set_base (u_int16 nx, u_int16 ny)
 Sets the base square of this object. More...
 
s_int8 get (igzstream &file)
 Loads an area from an opened file. More...
 
s_int8 put (ogzstream &file) const
 Saves an area into an opened file. More...
 
mapsquare_walkable_areaoperator= (const mapsquare_walkable_area &mo)
 Area copy (similar to copy ()). More...
 
void copy (const mapsquare_walkable_area &src)
 Synonym of operator = to guarantee its access from Python. More...
 
- Public Member Functions inherited from drawable
 drawable ()
 Default constructor. More...
 
virtual ~drawable ()
 Destructor. More...
 
u_int16 length () const
 Returns the length of the drawable. More...
 
u_int16 height () const
 Returns the height of the drawable. More...
 
virtual bool input_update ()
 Virtual input update function, provided for objects which doesn't need one. More...
 
- Public Member Functions inherited from character_base
 character_base ()
 Default constructor. More...
 
 ~character_base ()
 Destructor. More...
 
string get_name () const
 Returns the name of the character. More...
 
string get_id ()
 Returns an unique identifier of the character. More...
 
void set_name (string newname)
 Sets the name of the character. More...
 
u_int32 get_color () const
 Returns the color representing the character. More...
 
void set_color (int c)
 Sets the color representing the character. More...
 
string get_portrait () const
 Returns the current portrait of the character. More...
 
void set_portrait (string fname)
 Sets the current portrait of the character. More...
 
string get_dialogue () const
 Return the file name of the current character's dialog. More...
 
void set_dialogue (string dialogue)
 Sets the dialogue of the character. More...
 
void get_state (igzstream &in)
 Loads the state (attributes) of the character from an opened file. More...
 
void put_state (ogzstream &out)
 Saves the state (ttributes) of the character into an opened file. More...
 
- Public Member Functions inherited from storage
 storage ()
 Default constructor. More...
 
 ~storage ()
 Destructor. More...
 
void set_val (string key, s_int32 value)
 Sets key to value. More...
 
s_int32 get_val (string key)
 Returns the value of a key. More...
 
pair< string, s_int32next ()
 Returns the next (key, value) pair of the storage. More...
 
s_int32operator[] (string key)
 Returns the value of a key. More...
 
iterator begin ()
 Returns an iterator to the beginning of the storage. More...
 
iterator end ()
 Returns an iterator to the end of the storage. More...
 
u_int32 size () const
 Returns the size (number of elements) of the storage. More...
 
- Public Member Functions inherited from event_list
 event_list ()
 Constructor - creates an empty, unpaused event_list. More...
 
virtual ~event_list ()
 Destructor - unregisters and deletes all events owned by this list. More...
 
void clear ()
 Unregisters and deletes all events owned by this list. More...
 
void add_event (event *ev)
 Adds an event to this list. More...
 
void remove_event (event *ev)
 Removes an event from the list. More...
 
eventget_event (const string &id)
 Try to retrieve the event with given id from the list. More...
 
void put_state (ogzstream &out) const
 Save the event_list to a file. More...
 
bool get_state (igzstream &in)
 Loads the event_list from a file and registers all loaded events. More...
 
void pause ()
 Disable any events associated with this event_list. More...
 
void resume ()
 Re-enable the events associated with the event_list, thus 'awaking' the object to life again. More...
 
bool is_paused () const
 Check whether the event list is temporarily disabled or not. More...
 

Additional Inherited Members

- Public Types inherited from storage
typedef hash_map< string, s_int32 >::iterator iterator
 Storage iterator, similar to STL iterator. More...
 
- Static Public Member Functions inherited from event_list
static void register_event (u_int8 type, new_event e)
 Register an event for loading. More...
 
- Protected Member Functions inherited from drawable
void set_length (u_int16 l)
 Sets the length of the drawable. More...
 
void set_height (u_int16 h)
 Sets the height of the drawable. More...
 
- Protected Attributes inherited from event_list
std::vector< event * > Events
 List of events. More...
 

Detailed Description

Class holding game characters.

Definition at line 39 of file character.h.

Constructor & Destructor Documentation

◆ character()

character::character ( )

Default constructor.

Definition at line 34 of file character.cc.

◆ ~character()

character::~character ( )

Destructor.

Definition at line 38 of file character.cc.


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