Top | ![]() |
![]() |
![]() |
![]() |
gboolean | gva_nplayers_init () |
gboolean | gva_nplayers_lookup () |
const gchar * | gva_nplayers_describe () |
These functions provide a the maximum number of players for a game
and whether the play is alternating or simultaneous. The information
is read from a nplayers.ini
file.
gboolean
gva_nplayers_init (GError **error
);
Loads the number of players file. If an error occurs, it returns
FALSE
and sets error
.
This function should be called once when the application starts.
gboolean gva_nplayers_lookup (const gchar *game
,gint *max_alternating
,gint *max_simultaneous
,GError **error
);
Returns the maximum number of alternating and/or simultaneous players for
game
. If game
only allows alternating players, max_simultaneous
will
be zero. If game
only allows simultaneous players, max_alternating
will
be zero. If game
is listed in the file but the number of players is
unknown or cannot be parsed, both max_alternating
and max_simultaneous
will be zero. In all of these cases the function returns TRUE
.
If an error occurs, the function returns FALSE
and sets error
, leaving
max_alternating
and max_simultaneous
unaltered.
const gchar * gva_nplayers_describe (gint max_alternating
,gint max_simultaneous
);
Returns a human-readable description of the number of players a game
supports and whether the players alternate, play simultaneously, or
both. If a description can not be formed, the function returns NULL
.