2005-10-20 17:45:00 +02:00
|
|
|
/*
|
2005-11-26 17:52:51 +01:00
|
|
|
player_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 PLAYER_STRUCT_H
|
|
|
|
#define PLAYER_STRUCT_H
|
|
|
|
|
2005-01-09 21:21:22 +01:00
|
|
|
#include "bygfoot.h"
|
2005-03-03 13:46:48 +01:00
|
|
|
#include "enums.h"
|
2005-01-09 21:21:22 +01:00
|
|
|
#include "team_struct.h"
|
|
|
|
|
2004-12-30 17:48:19 +01:00
|
|
|
/**
|
2005-01-09 21:21:22 +01:00
|
|
|
Player positions.
|
2004-12-30 17:48:19 +01:00
|
|
|
*/
|
|
|
|
enum PlayerPos
|
|
|
|
{
|
|
|
|
PLAYER_POS_GOALIE = 0,
|
|
|
|
PLAYER_POS_DEFENDER,
|
|
|
|
PLAYER_POS_MIDFIELDER,
|
|
|
|
PLAYER_POS_FORWARD,
|
2005-07-14 18:05:10 +02:00
|
|
|
PLAYER_POS_ANY,
|
2004-12-30 17:48:19 +01:00
|
|
|
PLAYER_POS_END
|
|
|
|
};
|
|
|
|
|
2005-09-18 12:02:10 +02:00
|
|
|
/** Streaks a player can go on. */
|
|
|
|
enum PlayerStreak
|
|
|
|
{
|
|
|
|
PLAYER_STREAK_COLD = -1,
|
|
|
|
PLAYER_STREAK_NONE,
|
|
|
|
PLAYER_STREAK_HOT
|
|
|
|
};
|
|
|
|
|
2004-12-30 17:48:19 +01:00
|
|
|
/**
|
|
|
|
Cards in different cups are counted separately for players;
|
|
|
|
for each league or cup the cards are stored in such a struct.
|
|
|
|
*/
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
/** Numerical id of the league or cup. */
|
2005-01-09 21:21:22 +01:00
|
|
|
gint clid;
|
2004-12-30 17:48:19 +01:00
|
|
|
/** Number of yellow cards. */
|
|
|
|
gint yellow;
|
|
|
|
/** Number of weeks the player is banned. */
|
|
|
|
gint red;
|
|
|
|
} PlayerCard;
|
|
|
|
|
2005-01-09 21:21:22 +01:00
|
|
|
/**
|
|
|
|
Goals and games in different leagues and cups are counted separately for players.
|
|
|
|
*/
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
/** Numerical id of the league or cup. */
|
|
|
|
gint clid;
|
|
|
|
/** Number of games the player played. */
|
|
|
|
gint games;
|
|
|
|
/** Number of goals (scored for field players or conceded for goalies). */
|
|
|
|
gint goals;
|
2005-03-08 09:25:46 +01:00
|
|
|
/** Number of shots (taken or faced). */
|
|
|
|
gint shots;
|
2005-01-09 21:21:22 +01:00
|
|
|
} PlayerGamesGoals;
|
|
|
|
|
|
|
|
enum PlayerInjury
|
|
|
|
{
|
|
|
|
PLAYER_INJURY_NONE = 0,
|
2005-03-09 14:10:28 +01:00
|
|
|
PLAYER_INJURY_CONCUSSION,
|
|
|
|
PLAYER_INJURY_PULLED_MUSCLE,
|
|
|
|
PLAYER_INJURY_HAMSTRING,
|
|
|
|
PLAYER_INJURY_GROIN,
|
|
|
|
PLAYER_INJURY_FRAC_ANKLE,
|
|
|
|
PLAYER_INJURY_RIB,
|
|
|
|
PLAYER_INJURY_LEG,
|
|
|
|
PLAYER_INJURY_BROK_ANKLE,
|
|
|
|
PLAYER_INJURY_ARM,
|
|
|
|
PLAYER_INJURY_SHOULDER,
|
|
|
|
PLAYER_INJURY_LIGAMENT,
|
|
|
|
PLAYER_INJURY_CAREER_STOP,
|
2005-01-09 21:21:22 +01:00
|
|
|
PLAYER_INJURY_END
|
|
|
|
};
|
|
|
|
|
2005-05-19 21:43:22 +02:00
|
|
|
/** Enum for different player data. */
|
|
|
|
enum PlayerValue
|
|
|
|
{
|
|
|
|
PLAYER_VALUE_GAMES = 0,
|
|
|
|
PLAYER_VALUE_GOALS,
|
|
|
|
PLAYER_VALUE_SHOTS,
|
|
|
|
PLAYER_VALUE_CARD_YELLOW,
|
|
|
|
PLAYER_VALUE_CARD_RED,
|
|
|
|
PLAYER_VALUE_END
|
|
|
|
};
|
|
|
|
|
2009-03-08 12:34:30 +01:00
|
|
|
/** Enumeration for the yellow/red
|
|
|
|
card status during the live game. */
|
|
|
|
enum PlayerCardStatus
|
|
|
|
{
|
|
|
|
PLAYER_CARD_STATUS_NONE = 0,
|
|
|
|
PLAYER_CARD_STATUS_YELLOW,
|
|
|
|
PLAYER_CARD_STATUS_RED
|
|
|
|
};
|
2005-05-19 21:43:22 +02:00
|
|
|
|
2004-12-30 17:48:19 +01:00
|
|
|
/**
|
|
|
|
Representation of a player.
|
|
|
|
@see #PlayerAttributes
|
|
|
|
*/
|
|
|
|
typedef struct
|
|
|
|
{
|
2005-10-09 11:35:44 +02:00
|
|
|
gchar *name;
|
2004-12-30 17:48:19 +01:00
|
|
|
|
|
|
|
gint pos, /**< Position. @see #PlayerPos */
|
|
|
|
cpos, /**< Current position. @see #PlayerPos */
|
2005-09-18 12:02:10 +02:00
|
|
|
health, /**< Health. An integer signifying an injury or
|
|
|
|
good health. @see #PlayerInjury */
|
2004-12-30 17:48:19 +01:00
|
|
|
recovery, /**< Weeks until the player gets healthy. */
|
|
|
|
id, /**< Id of the player within the team. */
|
|
|
|
value, /**< Value of the player. */
|
2005-03-25 11:54:54 +01:00
|
|
|
wage, /**< Wage of the player. */
|
2005-09-18 12:02:10 +02:00
|
|
|
offers, /**< Number of times the player received a contract offer. */
|
2009-03-08 12:34:30 +01:00
|
|
|
streak, /**< The streak the player is on. */
|
|
|
|
card_status; /**< The card status of the player during a live game. */
|
2005-09-18 12:02:10 +02:00
|
|
|
|
|
|
|
gfloat skill, /**< Skill. Between 0 and a constant
|
|
|
|
(specified in the constants file). */
|
2005-03-13 16:46:15 +01:00
|
|
|
cskill, /**< Current Skill. */
|
|
|
|
talent, /**< Talent. The peak ability (which isn't always reached). */
|
|
|
|
etal[QUALITY_END], /**< Estimated talent (the user never sees the actual talent).
|
|
|
|
Depends on scout quality. */
|
|
|
|
fitness, /**< Fitness. Between 0 and 1. */
|
2005-09-18 12:02:10 +02:00
|
|
|
lsu, /**< Last skill update. Number of weeks since the player
|
|
|
|
skill was last updated. */
|
2005-03-13 16:46:15 +01:00
|
|
|
age, /**< Age in years. */
|
|
|
|
peak_age, /**< Age at which the player reaches his peak ability. */
|
2005-09-14 23:16:22 +02:00
|
|
|
peak_region, /**< Region around the peak age during which the player's
|
|
|
|
ability is at the peak (in years). */
|
2005-09-18 12:02:10 +02:00
|
|
|
contract, /**< The years until the player's contract expires. */
|
|
|
|
streak_prob, /**< This number determines how probable it is that a player
|
|
|
|
goes on a hot/cold streak. Between -1 and 1. */
|
|
|
|
streak_count; /**< How many weeks the streak goes (or how
|
|
|
|
long a new streak may not begin if the value
|
|
|
|
is negative). */
|
2005-03-13 16:46:15 +01:00
|
|
|
|
|
|
|
/** Whether the player participated in the team's last match. */
|
|
|
|
gboolean participation;
|
2005-01-09 21:21:22 +01:00
|
|
|
|
|
|
|
/** Array of games and goals; one item per league and cup.
|
|
|
|
@see PlayerGamesGoals */
|
|
|
|
GArray *games_goals;
|
2004-12-30 17:48:19 +01:00
|
|
|
|
2005-01-09 21:21:22 +01:00
|
|
|
/** Array of cards; one item per league and cup.
|
2004-12-30 17:48:19 +01:00
|
|
|
@see PlayerCard*/
|
|
|
|
GArray *cards;
|
2005-01-09 21:21:22 +01:00
|
|
|
|
2005-05-19 21:43:22 +02:00
|
|
|
/** Career goals, games etc. */
|
|
|
|
gint career[PLAYER_VALUE_END];
|
|
|
|
|
2005-01-09 21:21:22 +01:00
|
|
|
/** Pointer to the player's team. */
|
|
|
|
Team *team;
|
2004-12-30 17:48:19 +01:00
|
|
|
} Player;
|
|
|
|
|
2005-01-09 21:21:22 +01:00
|
|
|
/** Enum for player attributes that can be shown in a player list. */
|
|
|
|
enum PlayerListAttributeValue
|
|
|
|
{
|
|
|
|
PLAYER_LIST_ATTRIBUTE_NAME = 0,
|
|
|
|
PLAYER_LIST_ATTRIBUTE_CPOS,
|
|
|
|
PLAYER_LIST_ATTRIBUTE_POS,
|
|
|
|
PLAYER_LIST_ATTRIBUTE_CSKILL,
|
|
|
|
PLAYER_LIST_ATTRIBUTE_SKILL,
|
|
|
|
PLAYER_LIST_ATTRIBUTE_FITNESS,
|
|
|
|
PLAYER_LIST_ATTRIBUTE_GAMES,
|
2005-03-08 09:25:46 +01:00
|
|
|
PLAYER_LIST_ATTRIBUTE_SHOTS,
|
2005-03-09 14:10:28 +01:00
|
|
|
PLAYER_LIST_ATTRIBUTE_GOALS,
|
2005-01-09 21:21:22 +01:00
|
|
|
PLAYER_LIST_ATTRIBUTE_STATUS,
|
|
|
|
PLAYER_LIST_ATTRIBUTE_CARDS,
|
|
|
|
PLAYER_LIST_ATTRIBUTE_AGE,
|
|
|
|
PLAYER_LIST_ATTRIBUTE_ETAL,
|
|
|
|
PLAYER_LIST_ATTRIBUTE_VALUE,
|
|
|
|
PLAYER_LIST_ATTRIBUTE_WAGE,
|
|
|
|
PLAYER_LIST_ATTRIBUTE_CONTRACT,
|
|
|
|
PLAYER_LIST_ATTRIBUTE_TEAM,
|
|
|
|
PLAYER_LIST_ATTRIBUTE_LEAGUE_CUP,
|
|
|
|
PLAYER_LIST_ATTRIBUTE_END
|
|
|
|
};
|
|
|
|
|
2005-04-07 23:10:31 +02:00
|
|
|
enum PlayerInfoAttributeValue
|
|
|
|
{
|
|
|
|
PLAYER_INFO_ATTRIBUTE_NAME = 0,
|
|
|
|
PLAYER_INFO_ATTRIBUTE_POS,
|
|
|
|
PLAYER_INFO_ATTRIBUTE_CPOS,
|
|
|
|
PLAYER_INFO_ATTRIBUTE_SKILL,
|
|
|
|
PLAYER_INFO_ATTRIBUTE_CSKILL,
|
|
|
|
PLAYER_INFO_ATTRIBUTE_FITNESS,
|
|
|
|
PLAYER_INFO_ATTRIBUTE_ETAL,
|
|
|
|
PLAYER_INFO_ATTRIBUTE_AGE,
|
|
|
|
PLAYER_INFO_ATTRIBUTE_HEALTH,
|
|
|
|
PLAYER_INFO_ATTRIBUTE_VALUE,
|
|
|
|
PLAYER_INFO_ATTRIBUTE_WAGE,
|
|
|
|
PLAYER_INFO_ATTRIBUTE_CONTRACT,
|
|
|
|
PLAYER_INFO_ATTRIBUTE_GAMES_GOALS,
|
|
|
|
PLAYER_INFO_ATTRIBUTE_YELLOW_CARDS,
|
|
|
|
PLAYER_INFO_ATTRIBUTE_BANNED,
|
2005-09-18 12:02:10 +02:00
|
|
|
PLAYER_INFO_ATTRIBUTE_STREAK,
|
2005-05-19 21:43:22 +02:00
|
|
|
PLAYER_INFO_ATTRIBUTE_CAREER,
|
2005-04-07 23:10:31 +02:00
|
|
|
PLAYER_INFO_ATTRIBUTE_OFFERS,
|
|
|
|
PLAYER_INFO_ATTRIBUTE_END
|
|
|
|
};
|
|
|
|
|
2005-01-09 21:21:22 +01:00
|
|
|
/** A struct telling us which player attributes to show in a player list.
|
|
|
|
@see #PlayerListAttributeValue*/
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
gboolean on_off[PLAYER_LIST_ATTRIBUTE_END];
|
|
|
|
} PlayerListAttribute;
|
|
|
|
|
2004-12-30 17:48:19 +01:00
|
|
|
#endif
|