2005-10-20 17:45:00 +02:00
|
|
|
/*
|
2005-11-26 17:52:51 +01:00
|
|
|
cup.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 21:43:43 +01:00
|
|
|
#ifndef CUP_H
|
|
|
|
#define CUP_H
|
|
|
|
|
|
|
|
#include "bygfoot.h"
|
2004-12-30 17:48:19 +01:00
|
|
|
#include "cup_struct.h"
|
2005-03-14 18:47:27 +01:00
|
|
|
#include "fixture_struct.h"
|
2005-04-14 21:07:25 +02:00
|
|
|
#include "league_struct.h"
|
2004-12-23 21:43:43 +01:00
|
|
|
|
2005-04-22 17:17:39 +02:00
|
|
|
#define cup_get_last_tables_round(clid) &g_array_index(cup_from_clid(clid)->rounds, CupRound, cup_has_tables(clid))
|
|
|
|
#define cup_get_last_tables(clid) g_array_index(cup_from_clid(clid)->rounds, CupRound, cup_has_tables(clid)).tables
|
2004-12-23 21:43:43 +01:00
|
|
|
|
2005-04-14 21:07:25 +02:00
|
|
|
Cup
|
|
|
|
cup_new(gboolean new_id);
|
2004-12-23 21:43:43 +01:00
|
|
|
|
2004-12-30 17:48:19 +01:00
|
|
|
CupChooseTeam
|
|
|
|
cup_choose_team_new(void);
|
2004-12-23 21:43:43 +01:00
|
|
|
|
2004-12-30 17:48:19 +01:00
|
|
|
CupRound
|
|
|
|
cup_round_new(void);
|
|
|
|
|
|
|
|
void
|
2005-05-06 18:35:19 +02:00
|
|
|
cup_reset(Cup *cup);
|
2004-12-30 17:48:19 +01:00
|
|
|
|
2005-08-15 18:25:49 +02:00
|
|
|
void
|
2021-07-11 08:03:46 +02:00
|
|
|
cup_get_team_pointers(Cup *cup, gint round, gboolean preload);
|
2004-12-30 17:48:19 +01:00
|
|
|
|
|
|
|
void
|
2021-07-17 23:42:38 +02:00
|
|
|
cup_load_choose_team_generate(Cup *cup, GPtrArray *teams, const CupChooseTeam *ct);
|
2004-12-23 21:43:43 +01:00
|
|
|
|
2005-05-06 18:35:19 +02:00
|
|
|
void
|
2021-07-11 08:03:46 +02:00
|
|
|
cup_load_choose_team(Cup *cup, GPtrArray *teams, const CupChooseTeam *ct);
|
2005-01-09 21:21:22 +01:00
|
|
|
|
2008-11-18 19:32:37 +01:00
|
|
|
void
|
|
|
|
cup_load_choose_team_from_league(Cup *cup, const League *league,
|
|
|
|
GPtrArray *teams, const CupChooseTeam *ct);
|
|
|
|
|
|
|
|
void
|
2009-01-11 15:51:12 +01:00
|
|
|
cup_load_choose_team_from_cup(Cup *cup, const Cup *cup_team, GPtrArray *teams,
|
2021-07-11 08:03:46 +02:00
|
|
|
const CupChooseTeam *ct);
|
2008-11-18 19:32:37 +01:00
|
|
|
|
2005-01-09 21:21:22 +01:00
|
|
|
gint
|
2008-12-22 12:20:16 +01:00
|
|
|
cup_get_first_week_of_cup_round(Cup *cup, gint cup_round, gboolean with_delay);
|
2005-01-09 21:21:22 +01:00
|
|
|
|
|
|
|
gint
|
2005-08-14 21:03:11 +02:00
|
|
|
cup_get_matchdays_in_cup_round(const Cup *cup, gint round);
|
2005-01-09 21:21:22 +01:00
|
|
|
|
|
|
|
gint
|
2005-08-14 21:03:11 +02:00
|
|
|
cup_round_get_number_of_teams(const Cup *cup, gint round);
|
|
|
|
|
|
|
|
gint
|
|
|
|
cup_round_get_byes(const Cup *cup, gint round);
|
2005-06-08 19:43:28 +02:00
|
|
|
|
|
|
|
gint
|
|
|
|
cup_round_get_new_teams(const CupRound *cup_round);
|
2005-01-09 21:21:22 +01:00
|
|
|
|
2005-03-03 13:46:48 +01:00
|
|
|
Cup*
|
|
|
|
cup_from_clid(gint clid);
|
|
|
|
|
2005-05-06 18:35:19 +02:00
|
|
|
Cup*
|
|
|
|
cup_from_sid(const gchar* sid);
|
|
|
|
|
2005-03-14 18:47:27 +01:00
|
|
|
void
|
2009-01-04 11:53:09 +01:00
|
|
|
cup_round_get_name(const Fixture *fix, gchar *buf);
|
2005-03-14 18:47:27 +01:00
|
|
|
|
2005-04-13 15:01:59 +02:00
|
|
|
GPtrArray*
|
|
|
|
cup_get_teams_sorted(const Cup *cup);
|
|
|
|
|
2005-04-22 17:17:39 +02:00
|
|
|
gint
|
|
|
|
cup_compare_success_tables(const Team *tm1, const Team *tm2, const Cup *cup, gint round);
|
|
|
|
|
2005-04-13 15:01:59 +02:00
|
|
|
gint
|
|
|
|
cup_compare_success(gconstpointer a, gconstpointer b, gpointer data);
|
|
|
|
|
2005-06-25 16:09:37 +02:00
|
|
|
gint
|
|
|
|
cup_compare_success_knockout(const Team *tm1, const Team *tm2, const GArray *fixtures);
|
|
|
|
|
2005-04-13 15:01:59 +02:00
|
|
|
gint
|
|
|
|
cup_get_round_reached(const Team *tm, const GArray *fixtures);
|
|
|
|
|
2005-04-14 21:07:25 +02:00
|
|
|
gboolean
|
2005-05-06 18:35:19 +02:00
|
|
|
query_cup_begins(const Cup *cup);
|
2005-04-14 21:07:25 +02:00
|
|
|
|
2021-07-22 09:01:52 +02:00
|
|
|
gint
|
|
|
|
cup_choose_team_compute_start_idx(const CupChooseTeam *ct);
|
|
|
|
|
|
|
|
gint
|
|
|
|
cup_choose_team_compute_end_idx(const CupChooseTeam *ct, gint num_teams);
|
|
|
|
|
2005-04-14 21:07:25 +02:00
|
|
|
void
|
|
|
|
cup_get_choose_team_league_cup(const CupChooseTeam *ct,
|
2005-06-08 19:43:28 +02:00
|
|
|
const League **league, const Cup **cup);
|
2005-04-14 21:07:25 +02:00
|
|
|
|
|
|
|
gint
|
|
|
|
cup_get_last_week_from_first(const Cup *cup, gint first_week);
|
|
|
|
|
2005-04-16 09:46:04 +02:00
|
|
|
void
|
|
|
|
cup_get_round_name(const Cup *cup, gint round, gchar *buf);
|
|
|
|
|
2005-04-22 17:17:39 +02:00
|
|
|
gint
|
|
|
|
cup_has_tables(gint clid);
|
|
|
|
|
2005-05-01 12:16:14 +02:00
|
|
|
Team*
|
|
|
|
cup_get_winner(const Cup *cup);
|
|
|
|
|
2005-06-08 19:43:28 +02:00
|
|
|
gboolean
|
|
|
|
query_cup_transfer(void);
|
2005-05-21 11:18:25 +02:00
|
|
|
|
2005-05-28 16:34:14 +02:00
|
|
|
gchar*
|
|
|
|
cup_get_highlight_colour(const Cup *cup);
|
|
|
|
|
2008-11-23 16:06:00 +01:00
|
|
|
gboolean
|
|
|
|
cup_check_fixtures(const Cup *cup);
|
|
|
|
|
2008-12-28 16:44:12 +01:00
|
|
|
gboolean
|
|
|
|
cup_round_check_waits(const CupRound *cup_round);
|
|
|
|
|
2009-01-11 15:51:12 +01:00
|
|
|
gboolean
|
|
|
|
query_cup_self_referential(const Cup *cup);
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
query_cup_hidden(const Cup *cup);
|
|
|
|
|
2021-07-11 08:03:46 +02:00
|
|
|
GPtrArray *
|
|
|
|
cup_get_last_season_results(const Cup *cup);
|
|
|
|
|
2021-07-11 21:59:06 +02:00
|
|
|
GPtrArray *
|
|
|
|
cup_get_most_recent_results(const Cup *cup);
|
|
|
|
|
2004-12-23 21:43:43 +01:00
|
|
|
#endif
|