2005-10-20 15:45:00 +00:00
|
|
|
/*
|
2005-11-26 16:52:51 +00:00
|
|
|
league_struct.h
|
|
|
|
|
2005-10-20 15:45:00 +00:00
|
|
|
Bygfoot Football Manager -- a small and simple GTK2-based
|
|
|
|
football management game.
|
|
|
|
|
|
|
|
http://bygfoot.sourceforge.net
|
|
|
|
|
|
|
|
Copyright (C) 2005 Gyözö Both (gyboth@bygfoot.com)
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
2004-12-30 16:48:19 +00:00
|
|
|
#ifndef LEAGUE_STRUCT_H
|
|
|
|
#define LEAGUE_STRUCT_H
|
|
|
|
|
2005-01-09 20:21:22 +00:00
|
|
|
#include "bygfoot.h"
|
2005-03-15 15:10:57 +00:00
|
|
|
#include "cup_struct.h"
|
2005-04-29 19:48:02 +00:00
|
|
|
#include "stat_struct.h"
|
|
|
|
#include "table_struct.h"
|
2005-03-15 15:10:57 +00:00
|
|
|
|
|
|
|
enum PromRelType
|
|
|
|
{
|
|
|
|
PROM_REL_PROMOTION = 0,
|
|
|
|
PROM_REL_RELEGATION,
|
|
|
|
PROM_REL_NONE
|
|
|
|
};
|
2004-12-30 16:48:19 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
An element representing a promotion or relegation rule.
|
|
|
|
This means, a PromRelElement specifies a range of teams
|
|
|
|
that get promoted or relegated to a given league.
|
|
|
|
@see PromRel
|
|
|
|
*/
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
gint ranks[2]; /**< The range of teams; default 0 and 0 */
|
2005-10-09 09:35:44 +00:00
|
|
|
gchar *dest_sid; /**< The id of the destination league. Default "" */
|
2005-03-15 15:10:57 +00:00
|
|
|
gint type; /**< Type. Promotion or relegation or none. */
|
2004-12-30 16:48:19 +00:00
|
|
|
} PromRelElement;
|
|
|
|
|
|
|
|
/**
|
|
|
|
This structure specifies how promotion and relegation is handled in a league.
|
|
|
|
It contains promotion and relegation rules in an array and possibly also
|
|
|
|
a rule about promotion games to be played.
|
|
|
|
@see PromRelElement
|
|
|
|
*/
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
/** The id of the league the promotion games winner gets promoted to. Default "" */
|
2005-10-09 09:35:44 +00:00
|
|
|
gchar *prom_games_dest_sid;
|
2005-04-13 13:01:59 +00:00
|
|
|
|
|
|
|
/** The id of the league the promotion games losers get moved to. Default "" */
|
2005-10-09 09:35:44 +00:00
|
|
|
gchar *prom_games_loser_sid;
|
2005-04-13 13:01:59 +00:00
|
|
|
|
|
|
|
/** Number of teams that advance from the promotion games. Default: 1. */
|
2005-04-06 11:14:34 +00:00
|
|
|
gint prom_games_number_of_advance;
|
|
|
|
|
2004-12-30 16:48:19 +00:00
|
|
|
/** Array with promotion/relegation rules.
|
|
|
|
@see PromRelElement
|
|
|
|
*/
|
|
|
|
GArray *elements;
|
2005-03-15 15:10:57 +00:00
|
|
|
|
|
|
|
/** The cup determining how the promotion games are handled. */
|
2005-10-09 09:35:44 +00:00
|
|
|
gchar *prom_games_cup_sid;
|
2004-12-30 16:48:19 +00:00
|
|
|
} PromRel;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Representation of a league.
|
|
|
|
@see PromRel
|
|
|
|
@see Table
|
|
|
|
*/
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
/** Default value "" */
|
2005-10-09 09:35:44 +00:00
|
|
|
gchar *name, *short_name, *sid, *symbol;
|
2005-06-01 18:19:02 +00:00
|
|
|
/** The sid of the player names file the
|
|
|
|
teams in the league take their names from.
|
|
|
|
Default: 'general', meaning the 'player_names_general.xml' file. */
|
2005-10-09 09:35:44 +00:00
|
|
|
gchar *names_file;
|
2004-12-30 16:48:19 +00:00
|
|
|
/** @see PromRel */
|
|
|
|
PromRel prom_rel;
|
|
|
|
/** Numerical id, as opposed to the string id 'sid'. */
|
|
|
|
gint id;
|
2005-05-24 18:31:07 +00:00
|
|
|
/** Layer of the league; this specifies which leagues are
|
|
|
|
parallel. */
|
|
|
|
gint layer;
|
2004-12-30 16:48:19 +00:00
|
|
|
/** The first week games are played. Default 1. */
|
|
|
|
gint first_week;
|
|
|
|
/** Weeks between two matchdays. Default 1. */
|
|
|
|
gint week_gap;
|
2005-05-06 16:35:19 +00:00
|
|
|
/** How many round robins are played. Important for
|
|
|
|
small leagues with 10 teams or so. Default: 1. */
|
|
|
|
gint round_robins;
|
2004-12-30 16:48:19 +00:00
|
|
|
/** Number of yellow cards until a player gets banned.
|
|
|
|
Default 1000 (which means 'off', basically). */
|
|
|
|
gint yellow_red;
|
2005-09-21 17:42:41 +00:00
|
|
|
/** Average talent for the first season. Default: -1. */
|
|
|
|
gfloat average_talent;
|
2004-12-30 16:48:19 +00:00
|
|
|
/** Array of teams in the league.
|
|
|
|
@see Team */
|
|
|
|
GArray *teams;
|
|
|
|
/** League table.
|
|
|
|
@see Table */
|
|
|
|
Table table;
|
2005-01-09 20:21:22 +00:00
|
|
|
/** The fixtures of a season for the league. */
|
|
|
|
GArray *fixtures;
|
2005-04-29 19:48:02 +00:00
|
|
|
/** The current league statistics. */
|
|
|
|
LeagueStat stats;
|
2005-09-19 21:13:36 +00:00
|
|
|
/** Whether the league is only a container for teams
|
|
|
|
or really a league with fixtures and all. */
|
|
|
|
gboolean active;
|
2004-12-30 16:48:19 +00:00
|
|
|
} League;
|
|
|
|
|
|
|
|
#endif
|