GoPlayer

Name

GoPlayer -- player related information

Synopsis


#include <go-player.h>


struct      GoPlayer;
GtkObject*  go_player_new                   (GoData *data,
                                             const char *name,
                                             const char *token,
                                             const char *rank,
                                             double strength);
GtkObject*  go_player_read                  (GoData *data,
                                             xmlNodePtr node);
void        go_player_write                 (GoPlayer *self,
                                             xmlNodePtr node);

Object Hierarchy


  GtkObject
   +----GoPlayer

Args


  "name"                 gpointer             : Read / Write / Construct
  "token"                gpointer             : Read / Write / Construct Only
  "rank"                 gpointer             : Read / Write / Construct
  "strength"             gdouble              : Read / Write / Construct

Description

The GoPlayer object records all information about a single player.

Details

struct GoPlayer

struct GoPlayer {
	gchar * name;
	gchar * token;
	gchar * rank;
	double strength;
};


go_player_new ()

GtkObject*  go_player_new                   (GoData *data,
                                             const char *name,
                                             const char *token,
                                             const char *rank,
                                             double strength);

Allocate a new GoPlayer object, fill in the values, and connect it to data. If the strength value is unknown it should be set to -100.

data : a GoData object
name : the player's full name
token : the player's abbreviation
rank : the player's nominal rank, or NULL
strength : the player's numerical strength value
Returns : a newly allocated GoPlayer object.


go_player_read ()

GtkObject*  go_player_read                  (GoData *data,
                                             xmlNodePtr node);

This is a constructor for GoPlayer objects, which reads all data from a XML tree.

data : a GoData object
node : a XML element of type "player"
Returns : a newly allocated GoPlayer object.


go_player_write ()

void        go_player_write                 (GoPlayer *self,
                                             xmlNodePtr node);

Dump all player data into node.

self : a GoPlayer object
node : a XML element of type "player"

Args

"name" (gpointer : Read / Write / Construct)

"token" (gpointer : Read / Write / Construct Only)

"rank" (gpointer : Read / Write / Construct)

"strength" (gdouble : Read / Write / Construct)