mirror of https://github.com/tstellar/bygfoot.git
Def improvements, Italian definition corrected.
This commit is contained in:
parent
2862dc2263
commit
23fb53c5b8
|
@ -54,14 +54,14 @@ INCLUDES = -I.. -I$(top_srcdir)/intl
|
|||
COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
|
||||
|
||||
SOURCES =
|
||||
POFILES = de.po nl.po fr.po pl.po ro.po bg.po zh.po es.po da.po sv.po it.po
|
||||
GMOFILES = de.gmo nl.gmo fr.gmo pl.gmo ro.gmo bg.gmo zh.gmo es.gmo da.gmo sv.gmo it.gmo
|
||||
POFILES = de.po nl.po fr.po pl.po pt.po ro.po bg.po zh.po es.po da.po sv.po it.po
|
||||
GMOFILES = de.gmo nl.gmo fr.gmo pl.gmo pt.gmo ro.gmo bg.gmo zh.gmo es.gmo da.gmo sv.gmo it.gmo
|
||||
DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(GETTEXT_PACKAGE).pot \
|
||||
$(POFILES) $(GMOFILES) $(SOURCES)
|
||||
|
||||
POTFILES = \
|
||||
|
||||
CATALOGS = de.gmo nl.gmo fr.gmo pl.gmo ro.gmo bg.gmo zh.gmo es.gmo da.gmo sv.gmo it.gmo
|
||||
CATALOGS = de.gmo nl.gmo fr.gmo pl.gmo pt.gmo ro.gmo bg.gmo zh.gmo es.gmo da.gmo sv.gmo it.gmo
|
||||
CATOBJEXT = .gmo
|
||||
INSTOBJEXT = .mo
|
||||
|
||||
|
|
25
src/free.c
25
src/free.c
|
@ -381,16 +381,14 @@ free_league(League *league)
|
|||
free_gchar_ptr(league->short_name);
|
||||
free_gchar_ptr(league->symbol);
|
||||
free_gchar_ptr(league->sid);
|
||||
free_gchar_ptr(league->prom_rel.prom_games_dest_sid);
|
||||
free_gchar_ptr(league->prom_rel.prom_games_cup_sid);
|
||||
|
||||
if(league->teams != NULL)
|
||||
free_teams_array(&league->teams, FALSE);
|
||||
|
||||
free_joined_leagues(&league->joined_leagues);
|
||||
free_prom_rel(&league->prom_rel);
|
||||
|
||||
free_g_array(&league->teams);
|
||||
free_g_array(&league->prom_rel.elements);;
|
||||
|
||||
free_tables(&league->tables);
|
||||
free_new_tables(&league->new_tables);
|
||||
|
@ -404,6 +402,27 @@ free_league(League *league)
|
|||
free_league_stats(&league->stats);
|
||||
}
|
||||
|
||||
/** Free the promotion/relegation struct of a league. */
|
||||
void
|
||||
free_prom_rel(PromRel *prom_rel)
|
||||
{
|
||||
gint i;
|
||||
|
||||
for(i = 0; i < prom_rel->elements->len; i++)
|
||||
g_free(g_array_index(prom_rel->elements, PromRelElement, i).dest_sid);
|
||||
|
||||
free_g_array(&prom_rel->elements);
|
||||
|
||||
for(i = 0; i < prom_rel->prom_games->len; i++)
|
||||
{
|
||||
g_free(g_array_index(prom_rel->prom_games, PromGames, i).dest_sid);
|
||||
g_free(g_array_index(prom_rel->prom_games, PromGames, i).loser_sid);
|
||||
g_free(g_array_index(prom_rel->prom_games, PromGames, i).cup_sid);
|
||||
}
|
||||
|
||||
free_g_array(&prom_rel->prom_games);
|
||||
}
|
||||
|
||||
/** Free the data in the joined leagues array. */
|
||||
void
|
||||
free_joined_leagues(GArray **joined_leagues)
|
||||
|
|
|
@ -159,4 +159,7 @@ free_newspaper_article(NewsPaperArticle *article);
|
|||
void
|
||||
free_cup_round(CupRound *cup_round);
|
||||
|
||||
void
|
||||
free_prom_rel(PromRel *prom_rel);
|
||||
|
||||
#endif
|
||||
|
|
121
src/league.c
121
src/league.c
|
@ -62,12 +62,8 @@ league_new(gboolean new_id)
|
|||
|
||||
new.average_talent = 0;
|
||||
|
||||
new.prom_rel.prom_games_dest_sid = NULL;
|
||||
new.prom_rel.prom_games_loser_sid = NULL;
|
||||
new.prom_rel.prom_games_cup_sid = NULL;
|
||||
new.prom_rel.prom_games_number_of_advance = 1;
|
||||
|
||||
new.prom_rel.elements = g_array_new(FALSE, FALSE, sizeof(PromRelElement));
|
||||
new.prom_rel.prom_games = g_array_new(FALSE, FALSE, sizeof(PromGames));
|
||||
|
||||
new.teams = g_array_new(FALSE, FALSE, sizeof(Team));
|
||||
new.fixtures = g_array_new(FALSE, FALSE, sizeof(Fixture));
|
||||
|
@ -110,6 +106,27 @@ prom_rel_element_new(void)
|
|||
return new;
|
||||
}
|
||||
|
||||
/**
|
||||
Create a new PromGames with default values.
|
||||
@see PromGames
|
||||
*/
|
||||
PromGames
|
||||
prom_games_new(void)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
printf("prom_games_new\n");
|
||||
#endif
|
||||
|
||||
PromGames new;
|
||||
|
||||
new.dest_sid = NULL;
|
||||
new.loser_sid = NULL;
|
||||
new.cup_sid = NULL;
|
||||
new.number_of_advance = 1;
|
||||
|
||||
return new;
|
||||
}
|
||||
|
||||
/** Get the array index of the given league or cup id.
|
||||
@param clid The id of the league or cup.
|
||||
@return The index in the leagues or cups array. */
|
||||
|
@ -511,38 +528,41 @@ query_league_rank_in_prom_games(const League *league, gint rank)
|
|||
printf("query_league_rank_in_prom_games\n");
|
||||
#endif
|
||||
|
||||
gint i, j, k;
|
||||
gint i, j, k, l;
|
||||
const Cup *cup = NULL;
|
||||
const CupRound *cup_round = NULL;
|
||||
|
||||
for(i=0;i<ligs->len;i++)
|
||||
if(query_league_has_prom_games((&lig(i))))
|
||||
{
|
||||
cup = cup_from_sid(lig(i).prom_rel.prom_games_cup_sid);
|
||||
for(k=0;k<cup->rounds->len;k++)
|
||||
{
|
||||
cup_round = &g_array_index(cup->rounds, CupRound, k);
|
||||
for(j=0;j<cup_round->choose_teams->len;j++)
|
||||
{
|
||||
if(strcmp(g_array_index(cup_round->choose_teams, CupChooseTeam, j).sid,
|
||||
league->sid) == 0 &&
|
||||
((rank >= g_array_index(cup_round->choose_teams,
|
||||
CupChooseTeam, j).start_idx &&
|
||||
rank <= g_array_index(cup_round->choose_teams,
|
||||
CupChooseTeam, j).end_idx &&
|
||||
g_array_index(cup_round->choose_teams,
|
||||
CupChooseTeam, j).randomly) ||
|
||||
(rank >= g_array_index(cup_round->choose_teams,
|
||||
CupChooseTeam, j).start_idx &&
|
||||
rank < g_array_index(cup_round->choose_teams,
|
||||
CupChooseTeam, j).start_idx +
|
||||
g_array_index(cup_round->choose_teams,
|
||||
CupChooseTeam, j).number_of_teams &&
|
||||
!g_array_index(cup_round->choose_teams,
|
||||
CupChooseTeam, j).randomly)))
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
for(l = 0; l < lig(i).prom_rel.prom_games->len; l++)
|
||||
{
|
||||
cup = cup_from_sid(g_array_index(lig(i).prom_rel.prom_games, PromGames, l).cup_sid);
|
||||
for(k=0;k<cup->rounds->len;k++)
|
||||
{
|
||||
cup_round = &g_array_index(cup->rounds, CupRound, k);
|
||||
for(j=0;j<cup_round->choose_teams->len;j++)
|
||||
{
|
||||
if(strcmp(g_array_index(cup_round->choose_teams, CupChooseTeam, j).sid,
|
||||
league->sid) == 0 &&
|
||||
((rank >= g_array_index(cup_round->choose_teams,
|
||||
CupChooseTeam, j).start_idx &&
|
||||
rank <= g_array_index(cup_round->choose_teams,
|
||||
CupChooseTeam, j).end_idx &&
|
||||
g_array_index(cup_round->choose_teams,
|
||||
CupChooseTeam, j).randomly) ||
|
||||
(rank >= g_array_index(cup_round->choose_teams,
|
||||
CupChooseTeam, j).start_idx &&
|
||||
rank < g_array_index(cup_round->choose_teams,
|
||||
CupChooseTeam, j).start_idx +
|
||||
g_array_index(cup_round->choose_teams,
|
||||
CupChooseTeam, j).number_of_teams &&
|
||||
!g_array_index(cup_round->choose_teams,
|
||||
CupChooseTeam, j).randomly)))
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
|
@ -617,8 +637,9 @@ league_get_team_movements_prom_rel(const League *league, GArray *team_movements)
|
|||
/** Add the team movements from the promotion games
|
||||
to the array. */
|
||||
void
|
||||
league_get_team_movements_prom_games(const League *league, GArray *team_movements,
|
||||
const GPtrArray *prom_games_teams, gboolean up)
|
||||
league_get_team_movements_prom_games(const League *league, const PromGames *prom_games,
|
||||
GArray *team_movements, const GPtrArray *prom_games_teams,
|
||||
gboolean up)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
printf("league_get_team_movements_prom_games\n");
|
||||
|
@ -627,18 +648,18 @@ league_get_team_movements_prom_games(const League *league, GArray *team_movement
|
|||
gint i, j;
|
||||
TeamMove new_move;
|
||||
GPtrArray *dest_sids = (up) ?
|
||||
misc_separate_strings(league->prom_rel.prom_games_dest_sid) :
|
||||
misc_separate_strings(league->prom_rel.prom_games_loser_sid);
|
||||
misc_separate_strings(prom_games->dest_sid) :
|
||||
misc_separate_strings(prom_games->loser_sid);
|
||||
GArray *dest_idcs = NULL;
|
||||
gint dest_idcs_int[dest_sids->len];
|
||||
gint dest_idcs_order[dest_sids->len];
|
||||
gint start_idx = 0,
|
||||
end_idx = league->prom_rel.prom_games_number_of_advance;
|
||||
end_idx = prom_games->number_of_advance;
|
||||
gint prom_type = PROM_REL_PROMOTION;
|
||||
|
||||
if(!up)
|
||||
{
|
||||
start_idx = league->prom_rel.prom_games_number_of_advance;
|
||||
start_idx = prom_games->number_of_advance;
|
||||
end_idx = prom_games_teams->len;
|
||||
prom_type = PROM_REL_RELEGATION;
|
||||
}
|
||||
|
@ -674,6 +695,7 @@ league_get_team_movements(League *league, GArray *team_movements)
|
|||
printf("league_get_team_movements\n");
|
||||
#endif
|
||||
|
||||
gint i;
|
||||
GPtrArray *prom_games_teams = NULL;
|
||||
const Cup *prom_cup = NULL;
|
||||
|
||||
|
@ -681,24 +703,21 @@ league_get_team_movements(League *league, GArray *team_movements)
|
|||
|
||||
if(query_league_has_prom_games(league))
|
||||
{
|
||||
prom_cup = cup_from_sid(league->prom_rel.prom_games_cup_sid);
|
||||
for(i = 0; i < league->prom_rel.prom_games->len; i++)
|
||||
{
|
||||
prom_cup = cup_from_sid(g_array_index(league->prom_rel.prom_games, PromGames, i).cup_sid);
|
||||
|
||||
if(prom_cup == NULL)
|
||||
{
|
||||
g_warning("league_get_team_movements: promotion games cup not found for league %s (cup sid %s).\n",
|
||||
league->name, league->prom_rel.prom_games_cup_sid);
|
||||
return;
|
||||
}
|
||||
prom_games_teams = cup_get_teams_sorted(prom_cup);
|
||||
|
||||
prom_games_teams = cup_get_teams_sorted(prom_cup);
|
||||
league_get_team_movements_prom_games(league, &g_array_index(league->prom_rel.prom_games, PromGames, i),
|
||||
team_movements, prom_games_teams, TRUE);
|
||||
|
||||
league_get_team_movements_prom_games(league, team_movements, prom_games_teams, TRUE);
|
||||
|
||||
if(league->prom_rel.prom_games_loser_sid != NULL)
|
||||
league_get_team_movements_prom_games(league, team_movements,
|
||||
prom_games_teams, FALSE);
|
||||
if(g_array_index(league->prom_rel.prom_games, PromGames, i).loser_sid != NULL)
|
||||
league_get_team_movements_prom_games(league, &g_array_index(league->prom_rel.prom_games, PromGames, i),
|
||||
team_movements, prom_games_teams, FALSE);
|
||||
|
||||
g_ptr_array_free(prom_games_teams, TRUE);
|
||||
g_ptr_array_free(prom_games_teams, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
g_array_sort_with_data(league->teams, team_compare_func,
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
#define league_table_cumul(league) (&g_array_index((league)->tables, Table, 0))
|
||||
#define league_table(league) (&g_array_index((league)->tables, Table, league->tables->len - 1))
|
||||
|
||||
#define query_league_has_prom_games(league) (league->prom_rel.prom_games_dest_sid != NULL)
|
||||
#define query_league_has_prom_games(league) (league->prom_rel.prom_games->len > 0)
|
||||
#define query_league_active(league) (!query_league_cup_has_property((league)->id, "inactive"))
|
||||
|
||||
/** A struct needed when managing promotions
|
||||
|
@ -59,6 +59,9 @@ league_new(gboolean new_id);
|
|||
PromRelElement
|
||||
prom_rel_element_new(void);
|
||||
|
||||
PromGames
|
||||
prom_games_new(void);
|
||||
|
||||
gint
|
||||
league_cup_get_index_from_clid(gint clid);
|
||||
|
||||
|
@ -105,7 +108,8 @@ void
|
|||
league_get_team_movements_prom_rel(const League *league, GArray *team_movements);
|
||||
|
||||
void
|
||||
league_get_team_movements_prom_games(const League *league, GArray *team_movements,
|
||||
league_get_team_movements_prom_games(const League *league, const PromGames *prom_games,
|
||||
GArray *team_movements,
|
||||
const GPtrArray *prom_games_teams, gboolean up);
|
||||
|
||||
void
|
||||
|
|
|
@ -52,6 +52,22 @@ typedef struct
|
|||
gint type; /**< Type. Promotion or relegation or none. */
|
||||
} PromRelElement;
|
||||
|
||||
/**
|
||||
An element representing promotion/relegation games.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
/** The id of the league the promotion games winner gets promoted to. Default "" */
|
||||
gchar *dest_sid;
|
||||
/** The id of the league the promotion games losers get moved to. Default "" */
|
||||
gchar *loser_sid;
|
||||
/** Number of teams that advance from the promotion games. Default: 1. */
|
||||
gint number_of_advance;
|
||||
/** The cup determining how the promotion games are handled. */
|
||||
gchar *cup_sid;
|
||||
|
||||
} PromGames;
|
||||
|
||||
/**
|
||||
This structure specifies how promotion and relegation is handled in a league.
|
||||
It contains promotion and relegation rules in an array and possibly also
|
||||
|
@ -60,22 +76,16 @@ typedef struct
|
|||
*/
|
||||
typedef struct
|
||||
{
|
||||
/** The id of the league the promotion games winner gets promoted to. Default "" */
|
||||
gchar *prom_games_dest_sid;
|
||||
|
||||
/** The id of the league the promotion games losers get moved to. Default "" */
|
||||
gchar *prom_games_loser_sid;
|
||||
|
||||
/** Number of teams that advance from the promotion games. Default: 1. */
|
||||
gint prom_games_number_of_advance;
|
||||
|
||||
/** Array with promotion/relegation rules.
|
||||
@see PromRelElement
|
||||
*/
|
||||
GArray *elements;
|
||||
|
||||
/** The cup determining how the promotion games are handled. */
|
||||
gchar *prom_games_cup_sid;
|
||||
/** Array with promotion/relegation games.
|
||||
@see PromGames
|
||||
*/
|
||||
GArray *prom_games;
|
||||
|
||||
} PromRel;
|
||||
|
||||
/**
|
||||
|
|
|
@ -151,6 +151,7 @@ xml_league_read_start_element (GMarkupParseContext *context,
|
|||
#endif
|
||||
|
||||
PromRelElement new_element;
|
||||
PromGames new_prom_games;
|
||||
Team new_team;
|
||||
JoinedLeague new_joined_league;
|
||||
NewTable new_table;
|
||||
|
@ -214,7 +215,11 @@ xml_league_read_start_element (GMarkupParseContext *context,
|
|||
else if(strcmp(element_name, TAG_PROM_REL) == 0)
|
||||
state = STATE_PROM_REL;
|
||||
else if(strcmp(element_name, TAG_PROM_GAMES) == 0)
|
||||
state = STATE_PROM_GAMES;
|
||||
{
|
||||
state = STATE_PROM_GAMES;
|
||||
new_prom_games = prom_games_new();
|
||||
g_array_append_val(new_league.prom_rel.prom_games, new_prom_games);
|
||||
}
|
||||
else if(strcmp(element_name, TAG_PROM_GAMES_DEST_SID) == 0)
|
||||
state = STATE_PROM_GAMES_DEST_SID;
|
||||
else if(strcmp(element_name, TAG_PROM_GAMES_LOSER_SID) == 0)
|
||||
|
@ -394,13 +399,17 @@ xml_league_read_text (GMarkupParseContext *context,
|
|||
else if(state == STATE_TWO_MATCH_WEEK_END)
|
||||
g_array_append_val(new_league.two_match_weeks[1], int_value);
|
||||
else if(state == STATE_PROM_GAMES_DEST_SID)
|
||||
misc_string_assign(&new_league.prom_rel.prom_games_dest_sid, buf);
|
||||
g_array_index(new_league.prom_rel.prom_games, PromGames,
|
||||
new_league.prom_rel.prom_games->len - 1).dest_sid = g_strdup(buf);
|
||||
else if(state == STATE_PROM_GAMES_LOSER_SID)
|
||||
misc_string_assign(&new_league.prom_rel.prom_games_loser_sid, buf);
|
||||
g_array_index(new_league.prom_rel.prom_games, PromGames,
|
||||
new_league.prom_rel.prom_games->len - 1).loser_sid = g_strdup(buf);
|
||||
else if(state == STATE_PROM_GAMES_NUMBER_OF_ADVANCE)
|
||||
new_league.prom_rel.prom_games_number_of_advance = int_value;
|
||||
g_array_index(new_league.prom_rel.prom_games, PromGames,
|
||||
new_league.prom_rel.prom_games->len - 1).number_of_advance = int_value;
|
||||
else if(state == STATE_PROM_GAMES_CUP_SID)
|
||||
misc_string_assign(&new_league.prom_rel.prom_games_cup_sid, buf);
|
||||
g_array_index(new_league.prom_rel.prom_games, PromGames,
|
||||
new_league.prom_rel.prom_games->len - 1).cup_sid = g_strdup(buf);
|
||||
else if(state == STATE_PROM_REL_ELEMENT_RANK_START)
|
||||
g_array_index(new_league.prom_rel.elements,
|
||||
PromRelElement,
|
||||
|
|
|
@ -45,11 +45,11 @@ enum
|
|||
TAG_LEAGUE_ROUND_ROBINS,
|
||||
TAG_LEAGUE_AVERAGE_TALENT,
|
||||
TAG_LEAGUE_PROM_REL,
|
||||
TAG_LEAGUE_PROM_GAMES,
|
||||
TAG_LEAGUE_PROM_REL_PROM_GAMES_DEST_SID,
|
||||
TAG_LEAGUE_PROM_REL_PROM_GAMES_CUP_SID,
|
||||
TAG_LEAGUE_PROM_REL_PROM_GAMES_LOSER_SID,
|
||||
TAG_LEAGUE_PROM_REL_PROM_GAMES_NUMBER_OF_ADVANCE,
|
||||
TAG_LEAGUE_PROM_REL_CUP,
|
||||
TAG_LEAGUE_PROM_REL_ELEMENTS,
|
||||
TAG_LEAGUE_PROM_REL_ELEMENT,
|
||||
TAG_LEAGUE_PROM_REL_ELEMENT_RANK,
|
||||
|
@ -69,6 +69,7 @@ enum
|
|||
|
||||
gint promrankidx, state;
|
||||
PromRelElement new_element;
|
||||
PromGames new_prom_games;
|
||||
League *new_league;
|
||||
gchar *dirname;
|
||||
|
||||
|
@ -110,6 +111,9 @@ xml_loadsave_league_start_element (GMarkupParseContext *context,
|
|||
promrankidx = 0;
|
||||
}
|
||||
|
||||
if(tag == TAG_LEAGUE_PROM_GAMES)
|
||||
new_prom_games = prom_games_new();
|
||||
|
||||
if(tag == TAG_LEAGUE_JOINED_LEAGUE_SID)
|
||||
g_array_append_val(new_league->joined_leagues, new_joined_league);
|
||||
|
||||
|
@ -160,13 +164,18 @@ xml_loadsave_league_end_element (GMarkupParseContext *context,
|
|||
tag == TAG_YELLOW_RED ||
|
||||
tag == TAG_LEAGUE_PROM_REL)
|
||||
state = TAG_LEAGUE;
|
||||
else if(tag == TAG_LEAGUE_PROM_GAMES ||
|
||||
tag == TAG_LEAGUE_PROM_REL_ELEMENTS)
|
||||
{
|
||||
state = TAG_LEAGUE_PROM_REL;
|
||||
if(tag == TAG_LEAGUE_PROM_GAMES)
|
||||
g_array_append_val(new_league->prom_rel.prom_games, new_prom_games);
|
||||
}
|
||||
else if(tag == TAG_LEAGUE_PROM_REL_PROM_GAMES_DEST_SID ||
|
||||
tag == TAG_LEAGUE_PROM_REL_PROM_GAMES_CUP_SID ||
|
||||
tag == TAG_LEAGUE_PROM_REL_PROM_GAMES_LOSER_SID ||
|
||||
tag == TAG_LEAGUE_PROM_REL_PROM_GAMES_NUMBER_OF_ADVANCE ||
|
||||
tag == TAG_LEAGUE_PROM_REL_CUP ||
|
||||
tag == TAG_LEAGUE_PROM_REL_ELEMENTS)
|
||||
state = TAG_LEAGUE_PROM_REL;
|
||||
tag == TAG_LEAGUE_PROM_REL_PROM_GAMES_NUMBER_OF_ADVANCE)
|
||||
state = TAG_LEAGUE_PROM_GAMES;
|
||||
else if(tag == TAG_LEAGUE_PROM_REL_ELEMENT)
|
||||
{
|
||||
state = TAG_LEAGUE_PROM_REL_ELEMENTS;
|
||||
|
@ -265,13 +274,13 @@ xml_loadsave_league_text (GMarkupParseContext *context,
|
|||
else if(state == TAG_LEAGUE_AVERAGE_TALENT)
|
||||
new_league->average_talent = float_value;
|
||||
else if(state == TAG_LEAGUE_PROM_REL_PROM_GAMES_DEST_SID)
|
||||
misc_string_assign(&new_league->prom_rel.prom_games_dest_sid, buf);
|
||||
new_prom_games.dest_sid = g_strdup(buf);
|
||||
else if(state == TAG_LEAGUE_PROM_REL_PROM_GAMES_CUP_SID)
|
||||
misc_string_assign(&new_league->prom_rel.prom_games_cup_sid, buf);
|
||||
new_prom_games.cup_sid = g_strdup(buf);
|
||||
else if(state == TAG_LEAGUE_PROM_REL_PROM_GAMES_NUMBER_OF_ADVANCE)
|
||||
new_league->prom_rel.prom_games_number_of_advance = int_value;
|
||||
new_prom_games.number_of_advance = int_value;
|
||||
else if(state == TAG_LEAGUE_PROM_REL_PROM_GAMES_LOSER_SID)
|
||||
misc_string_assign(&new_league->prom_rel.prom_games_loser_sid, buf);
|
||||
new_prom_games.loser_sid = g_strdup(buf);
|
||||
else if(state == TAG_LEAGUE_PROM_REL_ELEMENT_RANK)
|
||||
new_element.ranks[promrankidx] = int_value;
|
||||
else if(state == TAG_LEAGUE_PROM_REL_ELEMENT_TYPE)
|
||||
|
@ -403,16 +412,36 @@ xml_loadsave_league_write(const gchar *prefix, const League *league)
|
|||
TAG_LEAGUE_TWO_MATCH_WEEK_END, I0);
|
||||
}
|
||||
|
||||
xml_loadsave_league_prom_rel_write(fil, league);
|
||||
|
||||
fprintf(fil, "%s</_%d>\n", I0, TAG_LEAGUE);
|
||||
|
||||
fclose(fil);
|
||||
}
|
||||
|
||||
/** Write the prom_rel data into the file. */
|
||||
void
|
||||
xml_loadsave_league_prom_rel_write(FILE *fil, const League *league)
|
||||
{
|
||||
gint i;
|
||||
|
||||
fprintf(fil, "%s<_%d>\n", I0, TAG_LEAGUE_PROM_REL);
|
||||
|
||||
xml_write_string(fil, league->prom_rel.prom_games_dest_sid,
|
||||
TAG_LEAGUE_PROM_REL_PROM_GAMES_DEST_SID, I1);
|
||||
xml_write_string(fil, league->prom_rel.prom_games_cup_sid,
|
||||
TAG_LEAGUE_PROM_REL_PROM_GAMES_CUP_SID, I1);
|
||||
xml_write_int(fil, league->prom_rel.prom_games_number_of_advance,
|
||||
TAG_LEAGUE_PROM_REL_PROM_GAMES_NUMBER_OF_ADVANCE, I1);
|
||||
xml_write_string(fil, league->prom_rel.prom_games_loser_sid,
|
||||
TAG_LEAGUE_PROM_REL_PROM_GAMES_LOSER_SID, I1);
|
||||
for(i = 0; i < league->prom_rel.prom_games->len; i++)
|
||||
{
|
||||
fprintf(fil, "%s<_%d>\n", I1, TAG_LEAGUE_PROM_GAMES);
|
||||
|
||||
xml_write_string(fil, g_array_index(league->prom_rel.prom_games, PromGames, i).dest_sid,
|
||||
TAG_LEAGUE_PROM_REL_PROM_GAMES_DEST_SID, I2);
|
||||
xml_write_string(fil, g_array_index(league->prom_rel.prom_games, PromGames, i).cup_sid,
|
||||
TAG_LEAGUE_PROM_REL_PROM_GAMES_CUP_SID, I2);
|
||||
xml_write_int(fil, g_array_index(league->prom_rel.prom_games, PromGames, i).number_of_advance,
|
||||
TAG_LEAGUE_PROM_REL_PROM_GAMES_NUMBER_OF_ADVANCE, I2);
|
||||
xml_write_string(fil, g_array_index(league->prom_rel.prom_games, PromGames, i).loser_sid,
|
||||
TAG_LEAGUE_PROM_REL_PROM_GAMES_LOSER_SID, I2);
|
||||
|
||||
fprintf(fil, "%s</_%d>\n", I1, TAG_LEAGUE_PROM_GAMES);
|
||||
}
|
||||
|
||||
fprintf(fil, "%s<_%d>\n", I1, TAG_LEAGUE_PROM_REL_ELEMENTS);
|
||||
for(i=0;i<league->prom_rel.elements->len;i++)
|
||||
|
@ -434,9 +463,4 @@ xml_loadsave_league_write(const gchar *prefix, const League *league)
|
|||
|
||||
fprintf(fil, "%s</_%d>\n", I0, TAG_LEAGUE_PROM_REL);
|
||||
|
||||
fprintf(fil, "%s</_%d>\n", I0, TAG_LEAGUE);
|
||||
|
||||
fclose(fil);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -56,4 +56,7 @@ xml_loadsave_league_write(const gchar *prefix, const League *league);
|
|||
void
|
||||
xml_loadsave_league_read(const gchar *filename, const gchar *team_file, League *league);
|
||||
|
||||
void
|
||||
xml_loadsave_league_prom_rel_write(FILE *fil, const League *league);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -22,15 +22,15 @@
|
|||
<cup>supercup_league_vs_cup</cup>
|
||||
<cup>supercup_europe_uefa</cup>
|
||||
<cup>supercup_europe_intercontinental</cup>
|
||||
<cup>italy_prom_games1</cup>
|
||||
<cup>italy_prom_games2</cup>
|
||||
<cup>italy_prom_games3</cup>
|
||||
<cup>italy_prom_games4</cup>
|
||||
<cup>italy_prom_games5</cup>
|
||||
<cup>italy_prom_games6</cup>
|
||||
<cup>italy_prom_games7</cup>
|
||||
<cup>italy_prom_games8</cup>
|
||||
<cup>italy_prom_games9</cup>
|
||||
<cup>italy_prom_games_2_1</cup>
|
||||
<cup>italy_prom_games_2_3</cup>
|
||||
<cup>italy_prom_games_3a_2</cup>
|
||||
<cup>italy_prom_games_3b_2</cup>
|
||||
<cup>italy_prom_games_3a_4</cup>
|
||||
<cup>italy_prom_games_3b_4</cup>
|
||||
<cup>italy_prom_games_4a_3</cup>
|
||||
<cup>italy_prom_games_4b_3</cup>
|
||||
<cup>italy_prom_games_4c_3</cup>
|
||||
</cups>
|
||||
|
||||
</country>
|
||||
|
|
|
@ -3,10 +3,11 @@
|
|||
<name>Serie B Promotion</name>
|
||||
<short_name>Serie B Prom.</short_name>
|
||||
<symbol>flag_italy.png</symbol>
|
||||
<sid>italy_prom_games1</sid>
|
||||
<sid>italy_prom_games_2_1</sid>
|
||||
<add_week>1000</add_week>
|
||||
<property>national</property>
|
||||
<property>highlight2</property>
|
||||
<property>promotion</property>
|
||||
|
||||
<cup_rounds>
|
||||
<cup_round>
|
|
@ -3,10 +3,11 @@
|
|||
<name>Serie B Relegation</name>
|
||||
<short_name>Serie B Rel.</short_name>
|
||||
<symbol>flag_italy.png</symbol>
|
||||
<sid>italy_prom_games2</sid>
|
||||
<sid>italy_prom_games_2_3</sid>
|
||||
<add_week>1000</add_week>
|
||||
<property>national</property>
|
||||
<property>highlight2</property>
|
||||
<property>promotion</property>
|
||||
|
||||
<cup_rounds>
|
||||
<cup_round>
|
|
@ -3,10 +3,11 @@
|
|||
<name>Prima Divisione A Promotion</name>
|
||||
<short_name>Pr. Div. A Prom.</short_name>
|
||||
<symbol>flag_italy.png</symbol>
|
||||
<sid>italy_prom_games3</sid>
|
||||
<sid>italy_prom_games_3a_2</sid>
|
||||
<add_week>1000</add_week>
|
||||
<property>national</property>
|
||||
<property>highlight2</property>
|
||||
<property>promotion</property>
|
||||
|
||||
<cup_rounds>
|
||||
<cup_round>
|
|
@ -3,16 +3,15 @@
|
|||
<name>Prima Divisione A Relegation</name>
|
||||
<short_name>Pr. Div. A Rel.</short_name>
|
||||
<symbol>flag_italy.png</symbol>
|
||||
<sid>italy_prom_games5</sid>
|
||||
<sid>italy_prom_games_3a_4</sid>
|
||||
<add_week>1000</add_week>
|
||||
<property>national</property>
|
||||
<property>highlight2</property>
|
||||
<property>promotion</property>
|
||||
|
||||
<cup_rounds>
|
||||
<cup_round>
|
||||
<home_away>1</home_away>
|
||||
<number_of_advance>2</number_of_advance>
|
||||
|
||||
<choose_teams>
|
||||
<choose_team>
|
||||
<choose_team_sid>italy3a</choose_team_sid>
|
|
@ -3,10 +3,11 @@
|
|||
<name>Prima Divisione B Promotion</name>
|
||||
<short_name>Pr. Div. B Prom.</short_name>
|
||||
<symbol>flag_italy.png</symbol>
|
||||
<sid>italy_prom_games4</sid>
|
||||
<sid>italy_prom_games_3b_2</sid>
|
||||
<add_week>1000</add_week>
|
||||
<property>national</property>
|
||||
<property>highlight2</property>
|
||||
<property>promotion</property>
|
||||
|
||||
<cup_rounds>
|
||||
<cup_round>
|
|
@ -3,16 +3,15 @@
|
|||
<name>Prima Divisione B Relegation</name>
|
||||
<short_name>Pr. Div. B Rel.</short_name>
|
||||
<symbol>flag_italy.png</symbol>
|
||||
<sid>italy_prom_games6</sid>
|
||||
<sid>italy_prom_games_3b_4</sid>
|
||||
<add_week>1000</add_week>
|
||||
<property>national</property>
|
||||
<property>highlight2</property>
|
||||
<property>promotion</property>
|
||||
|
||||
<cup_rounds>
|
||||
<cup_round>
|
||||
<home_away>1</home_away>
|
||||
<number_of_advance>2</number_of_advance>
|
||||
|
||||
<choose_teams>
|
||||
<choose_team>
|
||||
<choose_team_sid>italy3b</choose_team_sid>
|
|
@ -3,10 +3,11 @@
|
|||
<name>Seconda Divisione A Promotion</name>
|
||||
<short_name>S. Div. A Prom.</short_name>
|
||||
<symbol>flag_italy.png</symbol>
|
||||
<sid>italy_prom_games7</sid>
|
||||
<sid>italy_prom_games_4a_3</sid>
|
||||
<add_week>1000</add_week>
|
||||
<property>national</property>
|
||||
<property>highlight2</property>
|
||||
<property>promotion</property>
|
||||
|
||||
<cup_rounds>
|
||||
<cup_round>
|
|
@ -3,10 +3,11 @@
|
|||
<name>Seconda Divisione B Promotion</name>
|
||||
<short_name>S. Div. B Prom.</short_name>
|
||||
<symbol>flag_italy.png</symbol>
|
||||
<sid>italy_prom_games8</sid>
|
||||
<sid>italy_prom_games_4b_3</sid>
|
||||
<add_week>1000</add_week>
|
||||
<property>national</property>
|
||||
<property>highlight2</property>
|
||||
<property>promotion</property>
|
||||
|
||||
<cup_rounds>
|
||||
<cup_round>
|
|
@ -3,10 +3,11 @@
|
|||
<name>Seconda Divisione C Promotion</name>
|
||||
<short_name>S. Div. C Prom.</short_name>
|
||||
<symbol>flag_italy.png</symbol>
|
||||
<sid>italy_prom_games9</sid>
|
||||
<sid>italy_prom_games_4c_3</sid>
|
||||
<add_week>1000</add_week>
|
||||
<property>national</property>
|
||||
<property>highlight2</property>
|
||||
<property>promotion</property>
|
||||
|
||||
<cup_rounds>
|
||||
<cup_round>
|
|
@ -20,6 +20,18 @@
|
|||
<two_match_week_end>35</two_match_week_end>
|
||||
|
||||
<prom_rel>
|
||||
|
||||
<prom_games>
|
||||
<prom_games_dest_sid>italy1</prom_games_dest_sid>
|
||||
<prom_games_cup_sid>italy_prom_games_2_1</prom_games_cup_sid>
|
||||
</prom_games>
|
||||
|
||||
<prom_games>
|
||||
<prom_games_dest_sid>italy2</prom_games_dest_sid>
|
||||
<prom_games_loser_sid>italy3a italy3b</prom_games_loser_sid>
|
||||
<prom_games_cup_sid>italy_prom_games_2_3</prom_games_cup_sid>
|
||||
</prom_games>
|
||||
|
||||
<prom_rel_element>
|
||||
<rank_start>1</rank_start>
|
||||
<rank_end>2</rank_end>
|
||||
|
@ -27,13 +39,9 @@
|
|||
<prom_rel_type>promotion</prom_rel_type>
|
||||
</prom_rel_element>
|
||||
|
||||
<prom_games>
|
||||
<prom_games_dest_sid>italy1</prom_games_dest_sid>
|
||||
<prom_games_cup_sid>italy_prom_games1</prom_games_cup_sid>
|
||||
</prom_games>
|
||||
|
||||
<prom_rel_element>
|
||||
<rank_start>19</rank_start>
|
||||
<!-- <rank_start>19</rank_start> -->
|
||||
<rank_start>20</rank_start>
|
||||
<rank_end>22</rank_end>
|
||||
<dest_sid>italy3a italy3b</dest_sid>
|
||||
<prom_rel_type>relegation</prom_rel_type>
|
||||
|
|
|
@ -13,6 +13,18 @@
|
|||
<layer>3</layer>
|
||||
|
||||
<prom_rel>
|
||||
<prom_games>
|
||||
<prom_games_dest_sid>italy2</prom_games_dest_sid>
|
||||
<prom_games_cup_sid>italy_prom_games_3a_2</prom_games_cup_sid>
|
||||
</prom_games>
|
||||
|
||||
<prom_games>
|
||||
<prom_games_dest_sid>italy3a</prom_games_dest_sid>
|
||||
<prom_games_loser_sid>italy4a italy4b italy4c</prom_games_loser_sid>
|
||||
<prom_games_cup_sid>italy_prom_games_3a_4</prom_games_cup_sid>
|
||||
<prom_games_number_of_advance>2</prom_games_number_of_advance>
|
||||
</prom_games>
|
||||
|
||||
<prom_rel_element>
|
||||
<rank_start>1</rank_start>
|
||||
<rank_end>1</rank_end>
|
||||
|
@ -20,13 +32,8 @@
|
|||
<prom_rel_type>promotion</prom_rel_type>
|
||||
</prom_rel_element>
|
||||
|
||||
<prom_games>
|
||||
<prom_games_dest_sid>italy2</prom_games_dest_sid>
|
||||
<prom_games_cup_sid>italy_prom_games3</prom_games_cup_sid>
|
||||
</prom_games>
|
||||
|
||||
<prom_rel_element>
|
||||
<rank_start>16</rank_start>
|
||||
<rank_start>18</rank_start>
|
||||
<rank_end>18</rank_end>
|
||||
<dest_sid>italy4a italy4b italy4c</dest_sid>
|
||||
<prom_rel_type>relegation</prom_rel_type>
|
||||
|
|
|
@ -13,6 +13,18 @@
|
|||
<layer>3</layer>
|
||||
|
||||
<prom_rel>
|
||||
<prom_games>
|
||||
<prom_games_dest_sid>italy2</prom_games_dest_sid>
|
||||
<prom_games_cup_sid>italy_prom_games_3b_2</prom_games_cup_sid>
|
||||
</prom_games>
|
||||
|
||||
<prom_games>
|
||||
<prom_games_dest_sid>italy3b</prom_games_dest_sid>
|
||||
<prom_games_loser_sid>italy4a italy4b italy4c</prom_games_loser_sid>
|
||||
<prom_games_cup_sid>italy_prom_games_3b_4</prom_games_cup_sid>
|
||||
<prom_games_number_of_advance>2</prom_games_number_of_advance>
|
||||
</prom_games>
|
||||
|
||||
<prom_rel_element>
|
||||
<rank_start>1</rank_start>
|
||||
<rank_end>1</rank_end>
|
||||
|
@ -20,13 +32,8 @@
|
|||
<prom_rel_type>promotion</prom_rel_type>
|
||||
</prom_rel_element>
|
||||
|
||||
<prom_games>
|
||||
<prom_games_dest_sid>italy2</prom_games_dest_sid>
|
||||
<prom_games_cup_sid>italy_prom_games4</prom_games_cup_sid>
|
||||
</prom_games>
|
||||
|
||||
<prom_rel_element>
|
||||
<rank_start>16</rank_start>
|
||||
<rank_start>18</rank_start>
|
||||
<rank_end>18</rank_end>
|
||||
<dest_sid>italy4a italy4b italy4c</dest_sid>
|
||||
<prom_rel_type>relegation</prom_rel_type>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
<prom_games>
|
||||
<prom_games_dest_sid>italy3a italy3b</prom_games_dest_sid>
|
||||
<prom_games_cup_sid>italy_prom_games7</prom_games_cup_sid>
|
||||
<prom_games_cup_sid>italy_prom_games_4a_3</prom_games_cup_sid>
|
||||
</prom_games>
|
||||
</prom_rel>
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
<prom_games>
|
||||
<prom_games_dest_sid>italy3a italy3b</prom_games_dest_sid>
|
||||
<prom_games_cup_sid>italy_prom_games8</prom_games_cup_sid>
|
||||
<prom_games_cup_sid>italy_prom_games_4b_3</prom_games_cup_sid>
|
||||
</prom_games>
|
||||
</prom_rel>
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
<prom_games>
|
||||
<prom_games_dest_sid>italy3a italy3b</prom_games_dest_sid>
|
||||
<prom_games_cup_sid>italy_prom_games9</prom_games_cup_sid>
|
||||
<prom_games_cup_sid>italy_prom_games_4c_3</prom_games_cup_sid>
|
||||
</prom_games>
|
||||
</prom_rel>
|
||||
|
||||
|
|
Loading…
Reference in New Issue