2005-10-20 17:45:00 +02:00
|
|
|
/*
|
2005-11-26 17:52:51 +01:00
|
|
|
team_struct.h
|
|
|
|
|
2005-10-20 17:45:00 +02: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 17:48:19 +01:00
|
|
|
#ifndef TEAM_STRUCT_H
|
|
|
|
#define TEAM_STRUCT_H
|
|
|
|
|
2005-01-09 21:21:22 +01:00
|
|
|
#include "bygfoot.h"
|
|
|
|
|
2004-12-30 17:48:19 +01:00
|
|
|
/** @see team_return_league_cup_value_int() */
|
|
|
|
enum LeagueCupValue
|
|
|
|
{
|
|
|
|
LEAGUE_CUP_VALUE_NAME = 0,
|
|
|
|
LEAGUE_CUP_VALUE_SHORT_NAME,
|
|
|
|
LEAGUE_CUP_VALUE_SID,
|
|
|
|
LEAGUE_CUP_VALUE_SYMBOL,
|
|
|
|
LEAGUE_CUP_VALUE_ID,
|
|
|
|
LEAGUE_CUP_VALUE_FIRST_WEEK,
|
|
|
|
LEAGUE_CUP_VALUE_LAST_WEEK,
|
|
|
|
LEAGUE_CUP_VALUE_WEEK_GAP,
|
|
|
|
LEAGUE_CUP_VALUE_YELLOW_RED,
|
|
|
|
LEAGUE_CUP_VALUE_AVERAGE_SKILL,
|
|
|
|
LEAGUE_CUP_VALUE_AVERAGE_CAPACITY,
|
|
|
|
LEAGUE_CUP_VALUE_SKILL_DIFF,
|
|
|
|
LEAGUE_CUP_VALUE_END
|
|
|
|
};
|
|
|
|
|
2005-03-11 18:18:51 +01:00
|
|
|
/** Some team attributes. */
|
|
|
|
enum TeamAttribute
|
|
|
|
{
|
|
|
|
TEAM_ATTRIBUTE_STYLE = 0,
|
|
|
|
TEAM_ATTRIBUTE_BOOST,
|
|
|
|
TEAM_ATTRIBUTE_END
|
|
|
|
};
|
|
|
|
|
2004-12-30 17:48:19 +01:00
|
|
|
/** The stadium of a team. */
|
|
|
|
typedef struct
|
|
|
|
{
|
2005-10-09 11:35:44 +02:00
|
|
|
gchar *name;
|
2004-12-30 17:48:19 +01:00
|
|
|
gint capacity, /**< How many people fit in. Default: -1 (depends on league). */
|
|
|
|
average_attendance, /**< How many people watched on average. Default: 0. */
|
|
|
|
possible_attendance, /**< How many people would've watched if every game had been
|
|
|
|
sold out. We need this only to compute the average attendance in percentage
|
|
|
|
of the capacity. Default: 0. */
|
|
|
|
games; /**< Number of games. Default: 0. */
|
2005-03-13 16:46:15 +01:00
|
|
|
gfloat safety; /**< Safety percentage between 0 and 100. Default: randomized. */
|
2008-10-28 16:27:28 +01:00
|
|
|
gfloat ticket_price;
|
2005-03-13 16:46:15 +01:00
|
|
|
|
2004-12-30 17:48:19 +01:00
|
|
|
} Stadium;
|
|
|
|
|
|
|
|
/** Structure representing a team.
|
|
|
|
@see Player */
|
|
|
|
typedef struct
|
|
|
|
{
|
2005-10-09 11:35:44 +02:00
|
|
|
gchar *name, *symbol;
|
2005-06-01 20:19:02 +02:00
|
|
|
/** File the team takes the
|
|
|
|
player names from. */
|
2005-10-09 11:35:44 +02:00
|
|
|
gchar *names_file;
|
|
|
|
gchar *def_file;
|
2005-10-24 22:50:48 +02:00
|
|
|
/** The sid of the strategy if it's a CPU team. */
|
|
|
|
gchar *strategy_sid;
|
2005-06-01 20:19:02 +02:00
|
|
|
|
2004-12-30 17:48:19 +01:00
|
|
|
gint clid, /**< Numerical id of the league or cup the team belongs to. */
|
|
|
|
id, /**< Id of the team. */
|
|
|
|
structure, /**< Playing structure. @see team_assign_playing_structure() */
|
2005-03-09 14:10:28 +01:00
|
|
|
style, /**< Playing style. @see team_assign_playing_style() */
|
|
|
|
boost; /**< Whether player boost or anti-boost is switched on. */
|
2005-09-21 19:42:41 +02:00
|
|
|
|
|
|
|
/** Average talent of the players at generation. */
|
|
|
|
gfloat average_talent;
|
2006-12-10 15:43:16 +01:00
|
|
|
|
|
|
|
/** A value that influences scoring chances etc.
|
|
|
|
If > 1, the team's lucky, if < 1, it's unlucky.
|
|
|
|
Only used for users' teams. */
|
|
|
|
gfloat luck;
|
|
|
|
|
2004-12-30 17:48:19 +01:00
|
|
|
Stadium stadium;
|
|
|
|
/**
|
|
|
|
Array of players.
|
|
|
|
*/
|
|
|
|
GArray *players;
|
2020-10-02 16:23:25 +02:00
|
|
|
|
|
|
|
/** If this is a reserve team, then this will be the name of the the team's
|
|
|
|
* first team. Otherwise, this will be NULL. It is preferred to use
|
|
|
|
* first_team_id to access the first team. However, we need to keep a
|
|
|
|
* reference to the first team sid, because we do know the team ids yet
|
|
|
|
* for all teams when we parse team information in xml_league_read().
|
|
|
|
* The first_team_id will be computed later once all teams have been fully
|
|
|
|
* loaded from xml. */
|
|
|
|
gchar *first_team_sid;
|
|
|
|
/** id of the first team if this is a reserve team otherwise 0. */
|
|
|
|
gint first_team_id;
|
|
|
|
/** The level of an reserve team. e.g. If you have teams: Green,
|
|
|
|
* Green II, and Green III. Then the reserve_level will be 0, 2, and 3
|
|
|
|
* respectively. A value of 1 for this field is not valid. The reason
|
|
|
|
* to have Green II be level 2 and not 1 is because it makes the xml
|
|
|
|
* definitions less confusing.*/
|
|
|
|
gint reserve_level;
|
2004-12-30 17:48:19 +01:00
|
|
|
} Team;
|
|
|
|
|
|
|
|
#endif
|