2004-12-30 17:48:19 +01:00
|
|
|
#ifndef TABLE_STRUCT_H
|
|
|
|
#define TABLE_STRUCT_H
|
|
|
|
|
2005-01-09 21:21:22 +01:00
|
|
|
#include "bygfoot.h"
|
|
|
|
#include "team_struct.h"
|
|
|
|
|
2004-12-30 17:48:19 +01:00
|
|
|
/**
|
|
|
|
Table element values.
|
|
|
|
@see TableElement
|
|
|
|
@see Table
|
|
|
|
*/
|
|
|
|
enum TableElementValues
|
|
|
|
{
|
|
|
|
TABLE_PLAYED = 0,
|
|
|
|
TABLE_WON,
|
|
|
|
TABLE_DRAW,
|
|
|
|
TABLE_LOST,
|
|
|
|
TABLE_GF,
|
|
|
|
TABLE_GA,
|
2005-03-15 16:10:57 +01:00
|
|
|
TABLE_GD,
|
2004-12-30 17:48:19 +01:00
|
|
|
TABLE_PTS,
|
|
|
|
TABLE_END
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
An element representing a team in the tables.
|
|
|
|
@see Table
|
|
|
|
@see #TableElementValues
|
|
|
|
*/
|
|
|
|
typedef struct
|
|
|
|
{
|
2005-01-09 21:21:22 +01:00
|
|
|
Team *team;
|
2005-04-13 15:01:59 +02:00
|
|
|
gint team_id;
|
2005-05-02 16:39:30 +02:00
|
|
|
/** The rank of the element before the last update.
|
|
|
|
Used to display an arrow if the rank changed. */
|
|
|
|
gint old_rank;
|
2004-12-30 17:48:19 +01:00
|
|
|
gint values[TABLE_END];
|
|
|
|
} TableElement;
|
|
|
|
|
|
|
|
/**
|
|
|
|
A table belonging to a league or a cup with round robin.
|
|
|
|
@see TableElement
|
|
|
|
*/
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
GString *name;
|
2005-01-09 21:21:22 +01:00
|
|
|
gint clid;
|
2005-03-03 13:46:48 +01:00
|
|
|
/** The cup round (or -1 if it's a league). */
|
|
|
|
gint round;
|
2004-12-30 17:48:19 +01:00
|
|
|
GArray *elements;
|
|
|
|
} Table;
|
|
|
|
|
|
|
|
#endif
|