bygfoot/src/player.h

191 lines
4.4 KiB
C
Raw Normal View History

2005-10-20 17:45:00 +02:00
/*
2005-11-26 17:52:51 +01:00
player.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-23 13:58:39 +01:00
#ifndef PLAYER_H
#define PLAYER_H
#include "bygfoot.h"
#include "fixture_struct.h"
#include "maths.h"
#include "user_struct.h"
#include "player_struct.h"
#include "team_struct.h"
2004-12-23 13:58:39 +01:00
enum PlayerCompareAttrib
{
PLAYER_COMPARE_ATTRIBUTE_GAME_SKILL = 0,
2005-03-09 14:10:28 +01:00
PLAYER_COMPARE_ATTRIBUTE_POS,
2005-04-29 21:48:02 +02:00
PLAYER_COMPARE_ATTRIBUTE_LEAGUE_GOALS,
PLAYER_COMPARE_ATTRIBUTE_END
};
2005-10-24 22:50:48 +02:00
/** Whether or not a player is a youth according to his age. */
2005-07-08 11:26:00 +02:00
#define query_player_is_youth(pl) (pl->age <= const_float("float_player_age_lower"))
2005-10-24 22:50:48 +02:00
/** Whether the player belongs to a cpu team. */
#define query_player_is_cpu(pl) (team_is_user(pl->team) == -1)
2005-07-08 11:26:00 +02:00
/** Reset the streak counter. */
#define player_streak_reset_count(pl) pl->streak_count = -math_rnd((gfloat)const_int("int_player_streak_lock_length_lower"), (gfloat)const_int("int_player_streak_lock_length_upper"))
Player
2005-04-14 21:07:25 +02:00
player_new(Team *tm, gfloat average_skill, gboolean new_id);
gint
player_get_position_from_structure(gint structure, gint player_number);
2005-09-14 23:16:22 +02:00
gfloat
player_skill_from_talent(const Player *pl);
void
player_estimate_talent(Player *pl);
gint
player_assign_value(const Player *pl);
gint
player_assign_wage(const Player *pl);
2005-01-09 21:21:22 +01:00
gint
2005-03-08 09:25:46 +01:00
player_all_games_goals(const Player *pl, gint type);
2005-01-09 21:21:22 +01:00
gint
player_all_cards(const Player *pl);
Player*
2005-04-13 15:01:59 +02:00
player_of_idx_team(const Team *tm, gint number);
2005-01-09 21:21:22 +01:00
Player*
2005-04-13 15:01:59 +02:00
player_of_id_team(const Team *tm, gint id);
2005-01-09 21:21:22 +01:00
gint
player_compare_func(gconstpointer a, gconstpointer b, gpointer data);
2005-03-08 09:25:46 +01:00
gint
player_compare_substitute_func(gconstpointer a, gconstpointer b, gpointer data);
void
player_move(Team *tm1, gint player_number, Team *tm2, gint insert_at);
void
player_swap(Team *tm1, gint player_number1, Team *tm2, gint player_number2);
2005-03-13 16:46:15 +01:00
gfloat
2005-06-04 22:22:22 +02:00
player_get_cskill(const Player *pl, gint position, gboolean check_health);
gint
player_is_banned(const Player *pl);
2005-03-08 09:25:46 +01:00
gboolean
player_substitution_good_structure(gint old_structure, gint old_pos, gint player_pos);
gint
player_id_index(const Team *tm, gint player_id, gboolean stopWhenPlayerNotFound);
2005-03-08 09:25:46 +01:00
2005-03-09 14:10:28 +01:00
gfloat
player_get_game_skill(const Player *pl, gboolean skill, gboolean special);
2005-03-09 14:10:28 +01:00
2005-03-09 15:02:49 +01:00
void
player_decrease_fitness(Player *pl);
2005-03-10 21:59:39 +01:00
gint
player_card_get(const Player *pl, gint clid, gint card_type);
void
player_card_set(Player *pl, gint clid, gint card_type, gint value, gboolean diff);
2005-03-13 16:46:15 +01:00
void
2005-05-19 21:43:22 +02:00
player_games_goals_set(Player *pl, gint clid, gint type, gint value);
2005-03-13 16:46:15 +01:00
gint
player_games_goals_get(const Player *pl, gint clid, gint type);
void
2005-07-08 11:26:00 +02:00
player_update_weekly(Player *pl);
2005-03-13 16:46:15 +01:00
void
2005-07-08 11:26:00 +02:00
player_remove_contract(Player *pl);
2005-03-13 16:46:15 +01:00
void
player_update_skill(Player *pl);
void
player_update_fitness(Player *pl);
void
player_update_post_match(Player *pl, const Fixture *fix);
2005-03-13 16:46:15 +01:00
2005-03-13 22:10:19 +01:00
void
2005-03-19 21:04:08 +01:00
player_replace_by_new(Player *pl, gboolean free_player);
2005-03-13 22:10:19 +01:00
void
player_remove_from_team(Team *tm, gint idx);
2005-03-14 10:29:39 +01:00
void
player_update_week_roundly(Team *tm, gint idx);
2005-03-14 18:47:27 +01:00
void
player_update_injury(Player *pl);
2005-03-20 21:49:55 +01:00
void
player_copy(Player *pl, Team *tm, gint insert_at);
2005-04-07 18:44:33 +02:00
gchar*
player_injury_to_char(gint injury_type);
2005-06-04 22:22:22 +02:00
gboolean
query_player_id_in_team(gint player_id, const Team *tm);
2005-04-13 15:01:59 +02:00
void
player_season_start(Player *pl, gfloat skill_change);
2005-04-07 18:44:33 +02:00
gchar*
player_get_last_name(const gchar *name);
2005-06-21 15:33:16 +02:00
void
player_complete_def(Player *pl, gfloat average_skill);
2005-07-08 11:26:00 +02:00
GPtrArray*
player_get_pointers_from_array(const GArray *players);
void
player_move_to_ya(gint idx);
void
player_move_from_ya(gint idx);
void
player_streak_add_to_prob(Player *pl, gfloat add);
void
player_update_streak(Player *pl);
gboolean
query_player_is_in_ya(const Player *pl);
2008-05-02 14:26:35 +02:00
gboolean
query_player_star_balks(const Player *pl, const Team *tm, gboolean transfer);
2004-12-23 13:58:39 +01:00
#endif