mirror of https://github.com/tstellar/bygfoot.git
Add Bygfoot* parameter to start_week* functions
In the future, this structure will hold the bygfoot global state.
This commit is contained in:
parent
b060b141cc
commit
b76f817c93
|
@ -419,7 +419,7 @@ finance_assign_game_money(const Fixture *fix)
|
||||||
|
|
||||||
/** Change the current interest on the market (random walk with three possibilities). */
|
/** Change the current interest on the market (random walk with three possibilities). */
|
||||||
void
|
void
|
||||||
finance_update_current_interest(void)
|
finance_update_current_interest(Bygfoot *bygfoot)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf("finance_update_current_interest\n");
|
printf("finance_update_current_interest\n");
|
||||||
|
|
|
@ -57,7 +57,7 @@ void
|
||||||
finance_assign_game_money(const Fixture *fix);
|
finance_assign_game_money(const Fixture *fix);
|
||||||
|
|
||||||
void
|
void
|
||||||
finance_update_current_interest(void);
|
finance_update_current_interest(Bygfoot *bygfoot);
|
||||||
|
|
||||||
gint
|
gint
|
||||||
finance_calculate_alr_weekly_installment(gint start_week);
|
finance_calculate_alr_weekly_installment(gint start_week);
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
|
|
||||||
/** Update the job exchange: remove expired offers and add new ones. */
|
/** Update the job exchange: remove expired offers and add new ones. */
|
||||||
void
|
void
|
||||||
job_update(void)
|
job_update(Bygfoot *bygfoot)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf("job_update\n");
|
printf("job_update\n");
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#include "user_struct.h"
|
#include "user_struct.h"
|
||||||
|
|
||||||
void
|
void
|
||||||
job_update(void);
|
job_update(Bygfoot *bygfoot);
|
||||||
|
|
||||||
void
|
void
|
||||||
job_add_new_international(gint num_of_new);
|
job_add_new_international(gint num_of_new);
|
||||||
|
|
|
@ -70,7 +70,7 @@ WeekFunc start_week_round_funcs[] =
|
||||||
|
|
||||||
/** Array of functions called when a week
|
/** Array of functions called when a week
|
||||||
is started. */
|
is started. */
|
||||||
WeekFunc start_week_funcs[] =
|
WeekFuncBygfoot start_week_funcs[] =
|
||||||
{start_week_update_leagues, start_week_add_cups, start_week_update_users,
|
{start_week_update_leagues, start_week_add_cups, start_week_update_users,
|
||||||
start_week_update_teams, start_week_update_user_finances,
|
start_week_update_teams, start_week_update_user_finances,
|
||||||
youth_academy_update_weekly, transfer_update, job_update,
|
youth_academy_update_weekly, transfer_update, job_update,
|
||||||
|
@ -337,7 +337,7 @@ end_week_round(Bygfoot *bygfoot)
|
||||||
week++;
|
week++;
|
||||||
|
|
||||||
week_round = 1;
|
week_round = 1;
|
||||||
start_week();
|
start_week(bygfoot);
|
||||||
}
|
}
|
||||||
|
|
||||||
start_week_round(bygfoot);
|
start_week_round(bygfoot);
|
||||||
|
@ -586,17 +586,17 @@ start_week_round(Bygfoot *bygfoot)
|
||||||
|
|
||||||
/** Start a new week. */
|
/** Start a new week. */
|
||||||
void
|
void
|
||||||
start_week(void)
|
start_week(Bygfoot *bygfoot)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf("start_week\n");
|
printf("start_week\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
WeekFunc *start_func = start_week_funcs;
|
WeekFuncBygfoot *start_func = start_week_funcs;
|
||||||
|
|
||||||
while(*start_func != NULL)
|
while(*start_func != NULL)
|
||||||
{
|
{
|
||||||
(*start_func)();
|
(*start_func)(bygfoot);
|
||||||
start_func++;
|
start_func++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -640,7 +640,7 @@ end_week_hide_cups(void)
|
||||||
|
|
||||||
/** Add the cups that begin later in the season to the acps array. */
|
/** Add the cups that begin later in the season to the acps array. */
|
||||||
void
|
void
|
||||||
start_week_add_cups(void)
|
start_week_add_cups(Bygfoot *bygfoot)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf("start_week_add_cups\n");
|
printf("start_week_add_cups\n");
|
||||||
|
@ -660,7 +660,7 @@ start_week_add_cups(void)
|
||||||
CPU teams get updated at the end of their matches
|
CPU teams get updated at the end of their matches
|
||||||
(to avoid cup teams getting updated too often). */
|
(to avoid cup teams getting updated too often). */
|
||||||
void
|
void
|
||||||
start_week_update_teams(void)
|
start_week_update_teams(Bygfoot *bygfoot)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf("start_week_update_teams\n");
|
printf("start_week_update_teams\n");
|
||||||
|
@ -699,7 +699,7 @@ start_week_round_update_teams(void)
|
||||||
|
|
||||||
/** Deduce wages etc. */
|
/** Deduce wages etc. */
|
||||||
void
|
void
|
||||||
start_week_update_user_finances(void)
|
start_week_update_user_finances(Bygfoot *bygfoot)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf("start_week_update_user_finances\n");
|
printf("start_week_update_user_finances\n");
|
||||||
|
@ -716,7 +716,7 @@ start_week_update_user_finances(void)
|
||||||
|
|
||||||
/** Some general user update. */
|
/** Some general user update. */
|
||||||
void
|
void
|
||||||
start_week_update_users(void)
|
start_week_update_users(Bygfoot *bygfoot)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf("start_week_update_users\n");
|
printf("start_week_update_users\n");
|
||||||
|
@ -741,7 +741,7 @@ start_week_update_users(void)
|
||||||
|
|
||||||
/** Create new tables if necessary etc. */
|
/** Create new tables if necessary etc. */
|
||||||
void
|
void
|
||||||
start_week_update_leagues(void)
|
start_week_update_leagues(Bygfoot *bygfoot)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf("start_week_update_leagues\n");
|
printf("start_week_update_leagues\n");
|
||||||
|
|
|
@ -56,19 +56,19 @@ void
|
||||||
start_week_round(Bygfoot *bygfoot);
|
start_week_round(Bygfoot *bygfoot);
|
||||||
|
|
||||||
void
|
void
|
||||||
start_week(void);
|
start_week(Bygfoot *bygfoot);
|
||||||
|
|
||||||
void
|
void
|
||||||
start_week_update_teams(void);
|
start_week_update_teams(Bygfoot *bygfoot);
|
||||||
|
|
||||||
void
|
void
|
||||||
start_week_round_update_teams(void);
|
start_week_round_update_teams(void);
|
||||||
|
|
||||||
void
|
void
|
||||||
start_week_update_user_finances(void);
|
start_week_update_user_finances(Bygfoot *bygfoot);
|
||||||
|
|
||||||
void
|
void
|
||||||
start_week_update_users(void);
|
start_week_update_users(Bygfoot *bygfoot);
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
query_start_end_season_end(void);
|
query_start_end_season_end(void);
|
||||||
|
@ -83,7 +83,7 @@ void
|
||||||
end_season(void);
|
end_season(void);
|
||||||
|
|
||||||
void
|
void
|
||||||
start_week_add_cups(void);
|
start_week_add_cups(Bygfoot *bygfoot);
|
||||||
|
|
||||||
void
|
void
|
||||||
end_week_hide_cups(void);
|
end_week_hide_cups(void);
|
||||||
|
@ -92,7 +92,7 @@ void
|
||||||
start_new_season_reset_ids(void);
|
start_new_season_reset_ids(void);
|
||||||
|
|
||||||
void
|
void
|
||||||
start_week_update_leagues(void);
|
start_week_update_leagues(Bygfoot *bygfoot);
|
||||||
|
|
||||||
void
|
void
|
||||||
end_week_round_generate_news(Bygfoot *bygfoot);
|
end_week_round_generate_news(Bygfoot *bygfoot);
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
|
|
||||||
/** Weekly update of the transfer list. */
|
/** Weekly update of the transfer list. */
|
||||||
void
|
void
|
||||||
transfer_update(void)
|
transfer_update(Bygfoot *bygfoot)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf("transfer_update\n");
|
printf("transfer_update\n");
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
#define transoff(i, j) g_array_index(g_array_index(transfer_list, Transfer, i).offers, TransferOffer, j)
|
#define transoff(i, j) g_array_index(g_array_index(transfer_list, Transfer, i).offers, TransferOffer, j)
|
||||||
|
|
||||||
void
|
void
|
||||||
transfer_update(void);
|
transfer_update(Bygfoot *bygfoot);
|
||||||
|
|
||||||
void
|
void
|
||||||
transfer_add_cpu_offers(void);
|
transfer_add_cpu_offers(void);
|
||||||
|
|
|
@ -177,7 +177,7 @@ youth_academy_add_new_player(YouthAcademy *youth_academy)
|
||||||
|
|
||||||
/** Update the users' youth academies. */
|
/** Update the users' youth academies. */
|
||||||
void
|
void
|
||||||
youth_academy_update_weekly(void)
|
youth_academy_update_weekly(Bygfoot *bygfoot)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf("youth_academy_update_weekly\n");
|
printf("youth_academy_update_weekly\n");
|
||||||
|
|
|
@ -36,7 +36,7 @@ void
|
||||||
youth_academy_add_new_player(YouthAcademy *youth_academy);
|
youth_academy_add_new_player(YouthAcademy *youth_academy);
|
||||||
|
|
||||||
void
|
void
|
||||||
youth_academy_update_weekly(void);
|
youth_academy_update_weekly(Bygfoot *bygfoot);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue