Romanian definition added.

This commit is contained in:
gyboth 2005-04-23 19:48:02 +00:00
parent 7c12877dd5
commit a62634bfde
13 changed files with 343 additions and 35 deletions

View File

@ -31,6 +31,7 @@ cup_new(gboolean new_id)
new.week_gap = 1;
new.yellow_red = 1000;
new.skill_diff = 0;
new.overall_teams = -1;
new.choose_teams = g_array_new(FALSE, FALSE, sizeof(CupChooseTeam));
new.choose_team_user = cup_choose_team_new();
@ -175,8 +176,7 @@ cup_load_choose_teams(Cup *cup)
g_array_remove_index(teams, j);
free_g_string_array(&sids);
free_teams_array(&teams, FALSE);
free_teams_array(&teams, FALSE);
}
for(i=0;i<cup->teams->len;i++)
@ -622,8 +622,8 @@ cup_get_matchdays_in_cup_round(const Cup *cup, gint cup_round)
{
number_of_teams = cup_round_get_number_of_teams(cup, cup_round);
number_of_matchdays =
2 * (number_of_teams / g_array_index(cup->rounds, CupRound, cup_round).
round_robin_number_of_groups);
2 * ((number_of_teams / g_array_index(cup->rounds, CupRound, cup_round).
round_robin_number_of_groups) - 1);
}
else if(g_array_index(cup->rounds, CupRound, cup_round).home_away)
number_of_matchdays = 2;
@ -643,7 +643,7 @@ cup_round_get_number_of_teams(const Cup *cup, gint cup_round)
gint number_of_teams = -1;
if(cup_round == 0)
number_of_teams = cup->teams->len;
number_of_teams = cup->overall_teams;
else if(g_array_index(cup->rounds, CupRound, cup_round - 1).round_robin_number_of_groups > 0)
{
number_of_teams =
@ -666,6 +666,9 @@ cup_get_team_pointers(const Cup *cup)
gint i;
GPtrArray *teams = team_get_pointers_from_array(cup->teams);
while(teams->len + cup->user_teams->len > cup->overall_teams)
g_ptr_array_remove_index(teams, math_rndi(0, teams->len - 1));
for(i=0;i<cup->user_teams->len;i++)
g_ptr_array_add(teams, g_ptr_array_index(cup->user_teams, i));

View File

@ -91,13 +91,16 @@ typedef struct
the league with highest average skill.
Default: 0. */
gint skill_diff;
/** Array with rules how teams are chosen.
@see #CupChooseTeam */
/** Number of teams participating in the cup (important
only for international cups). */
gint overall_teams;
/** The week and week_round at the beginning of which the fixtures
have to be updated. */
gint next_fixture_update_week;
gint next_fixture_update_week_round;
/** Array with rules how teams are chosen.
@see #CupChooseTeam */
GArray *choose_teams;
/** The ChooseTeam rule according to which
the participant from the user's league is chosen.

View File

@ -18,6 +18,7 @@
#define TAG_WEEK_GAP "week_gap"
#define TAG_YELLOW_RED "yellow_red"
#define TAG_SKILL_DIFF "skill_diff"
#define TAG_OVERALL_TEAMS "overall_teams"
#define TAG_CUP_ROUNDS "cup_rounds"
#define TAG_CUP_ROUND "cup_round"
#define TAG_CUP_ROUND_HOME_AWAY "home_away"
@ -50,6 +51,7 @@ enum XmlCupStates
STATE_WEEK_GAP,
STATE_YELLOW_RED,
STATE_SKILL_DIFF,
STATE_OVERALL_TEAMS,
STATE_CUP_ROUNDS,
STATE_CUP_ROUND,
STATE_CUP_ROUND_HOME_AWAY,
@ -127,6 +129,8 @@ xml_cup_read_start_element (GMarkupParseContext *context,
state = STATE_YELLOW_RED;
else if(strcmp(element_name, TAG_SKILL_DIFF) == 0)
state = STATE_SKILL_DIFF;
else if(strcmp(element_name, TAG_OVERALL_TEAMS) == 0)
state = STATE_OVERALL_TEAMS;
else if(strcmp(element_name, TAG_CUP_ROUNDS) == 0)
state = STATE_CUP_ROUNDS;
else if(strcmp(element_name, TAG_CUP_ROUND) == 0)
@ -195,6 +199,7 @@ xml_cup_read_end_element (GMarkupParseContext *context,
strcmp(element_name, TAG_WEEK_GAP) == 0 ||
strcmp(element_name, TAG_YELLOW_RED) == 0 ||
strcmp(element_name, TAG_SKILL_DIFF) == 0 ||
strcmp(element_name, TAG_OVERALL_TEAMS) == 0 ||
strcmp(element_name, TAG_CUP_ROUNDS) == 0 ||
strcmp(element_name, TAG_CHOOSE_TEAMS) == 0)
state = STATE_CUP;
@ -281,6 +286,8 @@ xml_cup_read_text (GMarkupParseContext *context,
new_cup.yellow_red = value;
else if(state == STATE_SKILL_DIFF)
new_cup.skill_diff = value;
else if(state == STATE_OVERALL_TEAMS)
new_cup.overall_teams = value;
else if(state == STATE_CUP_ROUND_HOME_AWAY)
g_array_index(new_cup.rounds, CupRound, new_cup.rounds->len - 1).home_away = value;
else if(state == STATE_CUP_ROUND_REPLAY)

View File

@ -1,22 +1,28 @@
<country>
<name>Belgium</name>
<symbol>flag_be.png</symbol>
<sid>belgium</sid>
<leagues>
<league>belgium1</league>
<league>belgium2</league>
<league>belgium3a</league>
<league>belgium3b</league>
<league>belgium4a</league>
<league>belgium4b</league>
<league>belgium4c</league>
<league>belgium4d</league>
</leagues>
<name>Belgium</name>
<symbol>flag_be.png</symbol>
<sid>belgium</sid>
<leagues>
<league>belgium1</league>
<league>belgium2</league>
<league>belgium3a</league>
<league>belgium3b</league>
<league>belgium4a</league>
<league>belgium4b</league>
<league>belgium4c</league>
<league>belgium4d</league>
</leagues>
<cups>
<cup>belgium</cup>
<cup>europe_champ_league</cup>
<cup>europe_cwc</cup>
<cup>europe_uefa</cup>
</cups>
<supercups>
<cup>supercup_league_vs_cup</cup>
<cup>supercup_europe_uefa</cup>
</supercups>
<cups>
<cup>belgium</cup>
<cup>europe_champ_league</cup>
<cup>europe_cwc</cup>
<cup>europe_uefa</cup>
</cups>
</country>

View File

@ -7,6 +7,7 @@
<type>international</type>
<yellow_red>3</yellow_red>
<skill_diff>750</skill_diff>
<overall_teams>16</overall_teams>
<last_week>46</last_week>
<week_gap>4</week_gap>

View File

@ -7,6 +7,7 @@
<type>international</type>
<yellow_red>3</yellow_red>
<skill_diff>500</skill_diff>
<overall_teams>16</overall_teams>
<last_week>45</last_week>
<week_gap>4</week_gap>

View File

@ -7,6 +7,7 @@
<type>international</type>
<yellow_red>3</yellow_red>
<skill_diff>250</skill_diff>
<overall_teams>32</overall_teams>
<last_week>44</last_week>
<week_gap>4</week_gap>

View File

@ -45,15 +45,6 @@
<name>Belgrad</name>
</team>
<team>
<name>D. Bucuresti</name>
</team>
<team>
<name>R. Bucuresti</name>
</team>
<team>
<name>S. Bucuresti</name>
</team>
<team>
<name>Zagreb</name>
</team>
<team>

View File

@ -0,0 +1,20 @@
<country>
<name>România</name>
<symbol>flag_ro.png</symbol>
<sid>romania</sid>
<leagues>
<league>romania1</league>
<league>romania2</league>
<league>romania3</league>
</leagues>
<cups>
<cup>cupa_romaniei</cup>
<cup>europe_champ_league</cup>
<cup>europe_cwc</cup>
<cup>europe_uefa</cup>
</cups>
<supercups>
<!-- <cup>supercup_league_vs_cup</cup> -->
<cup>supercup_europe_uefa</cup>
</supercups>
</country>

View File

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<cup>
<name>Cupa României</name>
<short_name>Cupa Ro</short_name>
<symbol>flag_ro.png</symbol>
<sid>cupa_romaniei</sid>
<last_week>47</last_week>
<week_gap>4</week_gap>
<cup_rounds>
<cup_round>
<home_away>0</home_away>
<replay>1</replay>
</cup_round>
<cup_round>
<home_away>0</home_away>
<replay>1</replay>
</cup_round>
<cup_round>
<home_away>0</home_away>
<replay>1</replay>
</cup_round>
<cup_round>
<home_away>0</home_away>
<replay>1</replay>
</cup_round>
<cup_round>
<home_away>0</home_away>
<replay>1</replay>
</cup_round>
<cup_round>
<home_away>0</home_away>
<neutral>1</neutral>
<replay>1</replay>
</cup_round>
</cup_rounds>
<choose_teams>
<choose_team>
<choose_team_sid>romania1</choose_team_sid>
</choose_team>
<choose_team>
<choose_team_sid>romania2</choose_team_sid>
</choose_team>
<choose_team>
<choose_team_sid>romania3</choose_team_sid>
</choose_team>
</choose_teams>
</cup>

View File

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<league>
<sid>romania1</sid>
<name>Divizia A</name>
<short_name>DivA.</short_name>
<symbol>flag_ro.png</symbol>
<first_week>1</first_week>
<week_gap>1</week_gap>
<average_skill>6000</average_skill>
<prom_rel>
<prom_rel_element>
<rank_start>14</rank_start>
<rank_end>16</rank_end>
<dest_sid>romania2</dest_sid>
<prom_rel_type>relegation</prom_rel_type>
</prom_rel_element>
</prom_rel>
<teams>
<team>
<team_name>S. Bucureşti</team_name>
</team>
<team>
<team_name>D. Bucureşti</team_name>
</team>
<team>
<team_name>R. Bucureşti</team_name>
</team>
<team>
<team_name>Constanţa</team_name>
</team>
<team>
<team_name>N. Bucureşti</team_name>
</team>
<team>
<team_name>Galaţi</team_name>
</team>
<team>
<team_name>Bistriţa</team_name>
</team>
<team>
<team_name>S. Studenţesc</team_name>
</team>
<team>
<team_name>Cluj</team_name>
</team>
<team>
<team_name>Timişoara</team_name>
</team>
<team>
<team_name>Bacău</team_name>
</team>
<team>
<team_name>Argeş</team_name>
</team>
<team>
<team_name>Iaşi</team_name>
</team>
<team>
<team_name>Braşov</team_name>
</team>
<team>
<team_name>Alba Iulia</team_name>
</team>
<team>
<team_name>Craiova</team_name>
</team>
</teams>
</league>

View File

@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<league>
<sid>romania2</sid>
<name>Divizia B</name>
<short_name>Div.B</short_name>
<symbol>flag_ro.png</symbol>
<first_week>1</first_week>
<week_gap>1</week_gap>
<average_skill>4000</average_skill>
<prom_rel>
<prom_rel_element>
<rank_start>1</rank_start>
<rank_end>3</rank_end>
<dest_sid>romania1</dest_sid>
<prom_rel_type>promotion</prom_rel_type>
</prom_rel_element>
<prom_rel_element>
<rank_start>14</rank_start>
<rank_end>16</rank_end>
<dest_sid>romania3</dest_sid>
<prom_rel_type>relegation</prom_rel_type>
</prom_rel_element>
</prom_rel>
<teams>
<team>
<team_name>Brăila</team_name>
</team>
<team>
<team_name>Vaslui</team_name>
</team>
<team>
<team_name>Suceava</team_name>
</team>
<team>
<team_name>Neamţ</team_name>
</team>
<team>
<team_name>Năvodari</team_name>
</team>
<team>
<team_name>Mangalia</team_name>
</team>
<team>
<team_name>Botoşani</team_name>
</team>
<team>
<team_name>Buzău</team_name>
</team>
<team>
<team_name>Focşani</team_name>
</team>
<team>
<team_name>Sibiu</team_name>
</team>
<team>
<team_name>Ploieşti</team_name>
</team>
<team>
<team_name>Slatina</team_name>
</team>
<team>
<team_name>Piteşti</team_name>
</team>
<team>
<team_name>Oradea</team_name>
</team>
<team>
<team_name>Satu Mare</team_name>
</team>
<team>
<team_name>Arad</team_name>
</team>
</teams>
</league>

View File

@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<league>
<sid>romania3</sid>
<name>Divizia C</name>
<short_name>Div.C</short_name>
<symbol>flag_ro.png</symbol>
<first_week>1</first_week>
<week_gap>1</week_gap>
<average_skill>2000</average_skill>
<prom_rel>
<prom_rel_element>
<rank_start>1</rank_start>
<rank_end>3</rank_end>
<dest_sid>romania2</dest_sid>
<prom_rel_type>promotion</prom_rel_type>
</prom_rel_element>
</prom_rel>
<teams>
<team>
<team_name>Năvodari</team_name>
</team>
<team>
<team_name>Rădăuţi</team_name>
</team>
<team>
<team_name>Săcele</team_name>
</team>
<team>
<team_name>Roman</team_name>
</team>
<team>
<team_name>Otopeni</team_name>
</team>
<team>
<team_name>Motru</team_name>
</team>
<team>
<team_name>Mediaş</team_name>
</team>
<team>
<team_name>Alexandria</team_name>
</team>
<team>
<team_name>Zalău</team_name>
</team>
<team>
<team_name>Deva</team_name>
</team>
<team>
<team_name>Dej</team_name>
</team>
<team>
<team_name>Moineşti</team_name>
</team>
<team>
<team_name>Ghimbav</team_name>
</team>
<team>
<team_name>Urziceni</team_name>
</team>
<team>
<team_name>Caracal</team_name>
</team>
<team>
<team_name>Mioveni</team_name>
</team>
</teams>
</league>