/*
   team_struct.h

   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.
*/

#ifndef TEAM_STRUCT_H
#define TEAM_STRUCT_H

#include "bygfoot.h"

/** @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
};

/** Some team attributes. */
enum TeamAttribute
{
    TEAM_ATTRIBUTE_STYLE = 0,
    TEAM_ATTRIBUTE_BOOST,
    TEAM_ATTRIBUTE_END
};

/** The stadium of a team. */
typedef struct
{    
    gchar *name;
    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. */
    gfloat safety; /**< Safety percentage between 0 and 100. Default: randomized. */
    gfloat ticket_price;

} Stadium;

/** Structure representing a team.
    @see Player */
typedef struct
{
    gchar *name, *symbol;
    /** File the team takes the 
	player names from. */
    gchar *names_file;
    gchar *def_file;
    /** The sid of the strategy if it's a CPU team. */
    gchar *strategy_sid;

    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() */
	style, /**< Playing style. @see team_assign_playing_style() */
	boost; /**< Whether player boost or anti-boost is switched on. */

    /** Average talent of the players at generation. */
    gfloat average_talent;

    /** 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;    

    Stadium stadium;
    /**
       Array of players.
    */
    GArray *players;

    /** 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;
} Team;

#endif
