Logo Search packages:      
Sourcecode: mathwar version File versions  Download package

player.h File Reference


Detailed Description

Define player objects.

The player objects store data about both human and computer players.

The definition for the player structure is not visible outside of this module. All player operations should be handled via the defined interface methods. This may seem silly at this point, but the idea is to provide a consistent interface that can be easily expanded if the functionallity of the player increases as I develope this game.

Author:
Kenneth W. Sodemann <stufflehead@bigfoot.com>
Revision
1.3
Date
2002/05/24 22:11:39

Definition in file player.h.

#include <glib.h>

Go to the source code of this file.

Typedefs

typedef struct player_object player_object

Enumerations

enum  player_type { HUMAN = 1, COMPUTER }

Functions

player_objectcreate_player (const gchar *name, player_type type)
 Create a player object.
void destroy_player (player_object *player)
 Destroy a player object, freeing all memory used by it.
gint get_player_bonus (const player_object *player)
 Return the number of bonus points that the given player scored in the latest game.
gint get_player_correct_guesses (const player_object *player)
 Return the number of correct guesses that the given player made in the latest game.
gint get_player_guesses (const player_object *player)
 Return the number of guesses that the given player made in the latest game.
const gchar * get_player_name (const player_object *player)
 Return the type of player for the given player object.
gint get_player_score (const player_object *player)
 Return the score for the given player object.
player_type get_type_of_player (const player_object *player)
 Return the type of player for the given player object.
void reset_player (player_object *player)
 Reset the player for another game.
gint update_player_stats (player_object *player, gint score, gboolean is_bonus)
 Update the player's stats. This function should be called any time the player makes a guess, or gets bonus points.


Generated by  Doxygen 1.6.0   Back to index