2005-10-20 15:45:00 +00:00
|
|
|
/*
|
2005-11-26 16:52:51 +00:00
|
|
|
fixture.h
|
|
|
|
|
2005-10-20 15:45:00 +00: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 16:48:19 +00:00
|
|
|
#ifndef FIXTURE_H
|
|
|
|
#define FIXTURE_H
|
|
|
|
|
|
|
|
#include "bygfoot.h"
|
2005-01-09 20:21:22 +00:00
|
|
|
#include "cup_struct.h"
|
|
|
|
#include "fixture_struct.h"
|
|
|
|
#include "league_struct.h"
|
2004-12-30 16:48:19 +00:00
|
|
|
|
2005-03-21 12:39:05 +00:00
|
|
|
enum FixtureCompare
|
|
|
|
{
|
|
|
|
FIXTURE_COMPARE_DATE = 0,
|
|
|
|
FIXTURE_COMPARE_END
|
|
|
|
};
|
|
|
|
|
2005-05-31 14:42:20 +00:00
|
|
|
/** Check whether the team with given id participates in the fixture. */
|
|
|
|
#define query_fixture_team_involved(fix, team_id) (fix->team_ids[0] == team_id || fix->team_ids[1] == team_id)
|
2005-04-04 10:36:04 +00:00
|
|
|
|
2005-01-09 20:21:22 +00:00
|
|
|
void
|
|
|
|
fixture_write_league_fixtures(League *league);
|
2004-12-30 16:48:19 +00:00
|
|
|
|
2005-01-09 20:21:22 +00:00
|
|
|
void
|
|
|
|
fixture_write_cup_fixtures(Cup *cup);
|
2004-12-30 16:48:19 +00:00
|
|
|
|
2005-01-09 20:21:22 +00:00
|
|
|
void
|
2005-03-03 12:46:48 +00:00
|
|
|
fixture_write_cup_round_robin(Cup *cup, gint cup_round, GPtrArray *teams);
|
2004-12-30 16:48:19 +00:00
|
|
|
|
2005-01-09 20:21:22 +00:00
|
|
|
void
|
2005-05-21 09:18:25 +00:00
|
|
|
fixture_write_round_robin(gpointer league_cup, gint cup_round, GPtrArray *teams, gboolean one_round);
|
2004-12-30 16:48:19 +00:00
|
|
|
|
2005-01-09 20:21:22 +00:00
|
|
|
void
|
|
|
|
fixture_write_round_robin_matchday(GArray *fixtures, gint cup_round, GPtrArray *teams,
|
2005-05-31 14:42:20 +00:00
|
|
|
gint special, gint week_number,
|
2005-03-03 12:46:48 +00:00
|
|
|
gint clid, gboolean home_advantage);
|
2005-01-09 20:21:22 +00:00
|
|
|
|
|
|
|
void
|
2005-03-03 12:46:48 +00:00
|
|
|
fixture_write_knockout_round(Cup *cup, gint cup_round, GPtrArray *teams);
|
2005-01-09 20:21:22 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
fixture_write(GArray *fixtures, Team *home_team, Team *away_team, gint week_number,
|
2005-03-03 12:46:48 +00:00
|
|
|
gint week_round_number, gint clid, gint cup_round, gint replay_number,
|
|
|
|
gboolean home_advantage, gboolean second_leg, gboolean decisive);
|
|
|
|
|
|
|
|
void
|
|
|
|
fixture_update(Cup *cup);
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
fixture_update_write_replays(Cup *cup);
|
|
|
|
|
|
|
|
GPtrArray*
|
|
|
|
fixture_get_cup_round_winners(const Cup *cup);
|
|
|
|
|
|
|
|
GPtrArray*
|
2005-03-15 15:10:57 +00:00
|
|
|
fixture_get_round_robin_advance(const Cup *cup, gint round);
|
2005-03-03 12:46:48 +00:00
|
|
|
|
2005-04-13 13:01:59 +00:00
|
|
|
gpointer
|
|
|
|
fixture_winner_of(const Fixture *fix, gboolean team_id);
|
2005-01-09 20:21:22 +00:00
|
|
|
|
|
|
|
gint
|
2005-05-31 14:42:20 +00:00
|
|
|
fixture_get_free_round(gint week_number, const GPtrArray *teams,
|
|
|
|
gint team_id1, gint team_id2);
|
2005-01-09 20:21:22 +00:00
|
|
|
|
|
|
|
gboolean
|
|
|
|
query_fixture_is_earlier(const Fixture *fix1, const Fixture *fix2);
|
|
|
|
|
2005-03-14 17:47:27 +00:00
|
|
|
gboolean
|
|
|
|
query_fixture_is_later(const Fixture *fix1, const Fixture *fix2);
|
|
|
|
|
2005-01-09 20:21:22 +00:00
|
|
|
gboolean
|
|
|
|
query_fixture_is_draw(const Fixture *fix);
|
|
|
|
|
2005-03-03 12:46:48 +00:00
|
|
|
gint
|
|
|
|
fixture_user_team_involved(const Fixture *fix);
|
|
|
|
|
2005-01-09 20:21:22 +00:00
|
|
|
gboolean
|
2005-03-03 12:46:48 +00:00
|
|
|
query_fixture_has_tables(const Fixture *fix);
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
query_fixture_in_week_round(gint clid, gint week_number, gint week_round_number);
|
|
|
|
|
|
|
|
Fixture*
|
|
|
|
fixture_get_first_leg(const Fixture *fix);
|
2004-12-30 16:48:19 +00:00
|
|
|
|
2005-03-14 17:47:27 +00:00
|
|
|
GPtrArray*
|
2005-04-15 13:55:59 +00:00
|
|
|
fixture_get_week_list_clid(gint clid, gint week_number, gint week_round_number);
|
2005-03-14 17:47:27 +00:00
|
|
|
|
|
|
|
void
|
2005-10-04 14:47:15 +00:00
|
|
|
fixture_result_to_buf(const Fixture *fix, gchar *buf, gboolean swap);
|
2005-03-14 17:47:27 +00:00
|
|
|
|
|
|
|
gint
|
|
|
|
fixture_get_number_of_matches(gint week_number, gint week_round_number);
|
|
|
|
|
|
|
|
Fixture*
|
|
|
|
fixture_get(gint type, gint clid, gint week_number, gint week_round_number, const Team *tm);
|
|
|
|
|
|
|
|
Fixture*
|
|
|
|
fixture_get_next(gint clid, gint week_number, gint week_round_number);
|
|
|
|
|
|
|
|
Fixture*
|
|
|
|
fixture_get_previous(gint clid, gint week_number, gint week_round_number);
|
|
|
|
|
2005-03-21 12:39:05 +00:00
|
|
|
GPtrArray*
|
|
|
|
fixture_get_latest(const Team *tm);
|
|
|
|
|
|
|
|
gint
|
|
|
|
fixture_compare_func(gconstpointer a, gconstpointer b, gpointer data);
|
|
|
|
|
2005-03-23 19:03:26 +00:00
|
|
|
GPtrArray*
|
|
|
|
fixture_get_matches(const Team *tm1, const Team *tm2);
|
|
|
|
|
2005-03-27 17:59:57 +00:00
|
|
|
GPtrArray*
|
|
|
|
fixture_get_coming(const Team *tm);
|
|
|
|
|
2005-05-31 14:42:20 +00:00
|
|
|
Fixture*
|
2006-03-26 14:14:45 +00:00
|
|
|
fixture_from_id(gint id, gboolean abort_program);
|
2005-04-04 10:36:04 +00:00
|
|
|
|
2005-04-13 13:01:59 +00:00
|
|
|
gint
|
2005-04-15 13:55:59 +00:00
|
|
|
fixture_get_last_week_round(gint week_number);
|
|
|
|
|
|
|
|
void
|
|
|
|
fixture_get_next_week(gint *week_number, gint *week_round_number);
|
|
|
|
|
|
|
|
void
|
|
|
|
fixture_get_previous_week(gint *week_number, gint *week_round_number);
|
|
|
|
|
|
|
|
GPtrArray*
|
|
|
|
fixture_get_week_list(gint week_number, gint week_round_number);
|
2005-04-13 13:01:59 +00:00
|
|
|
|
2005-10-03 18:08:26 +00:00
|
|
|
GPtrArray*
|
|
|
|
fixture_get_season_results(void);
|
|
|
|
|
2005-10-24 20:50:48 +00:00
|
|
|
gint
|
|
|
|
fixture_get_goals_to_win(const Fixture *fix, const Team *tm);
|
|
|
|
|
2007-03-03 18:24:26 +00:00
|
|
|
gint
|
|
|
|
fixture_count_matchdays(const GArray *fixtures);
|
|
|
|
|
|
|
|
|
2004-12-30 16:48:19 +00:00
|
|
|
#endif
|