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

player_object* create_player ( const gchar *  name,
player_type  type 
)

Create a player object.

Parameters:
name The name that the player should have
type The type of player to create (see player_type)
Returns:
A pointer to the newly created player object.

Definition at line 52 of file player.c.

{
   player_object   *new_player = NULL;

   new_player = g_malloc (sizeof (player_object));
   new_player->name = g_string_new (name);
   new_player->score = 0;
   new_player->guesses = 0;
   new_player->correct = 0;
   new_player->bonus = 0;
   new_player->type = type;

   return new_player;
}


Generated by  Doxygen 1.6.0   Back to index