2021-05-25 13:24:48 +02:00
|
|
|
#ifndef _PLAGUE_CORE_H
|
|
|
|
#define _PLAGUE_CORE_H
|
|
|
|
|
|
|
|
// Duration for internal clock
|
|
|
|
#define ENGINE_TICK 50
|
2021-05-29 16:44:46 +02:00
|
|
|
#define CURSOR_TICK 100
|
2021-05-25 13:24:48 +02:00
|
|
|
|
|
|
|
// Number of planes on screen
|
|
|
|
#define NB_PLANES 5
|
|
|
|
|
|
|
|
// Number of humans
|
|
|
|
#define TOTAL_POP 10000000000
|
|
|
|
|
|
|
|
// game : all statistics of the current game
|
|
|
|
struct game
|
|
|
|
{
|
|
|
|
// Disease parameters
|
|
|
|
int contagion, severity, lethality;
|
|
|
|
|
|
|
|
// DNA points
|
|
|
|
int dna;
|
|
|
|
|
|
|
|
// Mutations counts and sprite selected
|
|
|
|
int abilities, symptoms, transmissions;
|
|
|
|
int abilities_sel, symptoms_sel, transmissions_sel;
|
|
|
|
|
|
|
|
// Research data
|
|
|
|
int research, limit;
|
|
|
|
|
|
|
|
// Infectious pattern parameters
|
|
|
|
long long int healthy, infected, dead, cured;
|
|
|
|
|
|
|
|
// Time
|
|
|
|
int time;
|
|
|
|
|
|
|
|
// Planes
|
|
|
|
struct plane *planes[NB_PLANES + 1];
|
|
|
|
};
|
|
|
|
|
|
|
|
// plane : information about planes
|
|
|
|
struct plane
|
|
|
|
{
|
|
|
|
// Plane's coordinates
|
|
|
|
int x, y;
|
|
|
|
|
|
|
|
// Plane's direction
|
|
|
|
int direction;
|
|
|
|
|
|
|
|
// Coordinates of the plane's destination
|
|
|
|
int dest_x, dest_y;
|
|
|
|
|
2021-05-27 22:09:01 +02:00
|
|
|
// Coordinates of the plane's departure
|
2021-05-25 13:24:48 +02:00
|
|
|
int depa_x, depa_y;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2021-05-27 22:09:01 +02:00
|
|
|
//cursor : cursor information for mutations selection
|
|
|
|
struct cursor
|
|
|
|
{
|
|
|
|
// Cursor's coordinates
|
|
|
|
int x, y;
|
|
|
|
|
|
|
|
// If the cursor should be displayed
|
|
|
|
int display;
|
|
|
|
};
|
|
|
|
|
2021-05-25 13:24:48 +02:00
|
|
|
// get_inputs : detect and manage inputs
|
|
|
|
int get_inputs(const int background, int *mutation_menu);
|
|
|
|
|
|
|
|
// next_frame : compute the plane's positions
|
|
|
|
void next_frame(struct game *current_game);
|
|
|
|
|
2021-05-27 22:09:01 +02:00
|
|
|
// rtc_key : get the key with RTC system
|
|
|
|
int rtc_key(void);
|
|
|
|
|
|
|
|
// callback_timer : basic timer
|
|
|
|
int callback_tick(volatile int *tick);
|
2021-05-25 13:24:48 +02:00
|
|
|
|
2021-05-29 17:02:07 +02:00
|
|
|
// manage_mutation : an independant sub-programm which allow to select and see the mutations.
|
|
|
|
void mutation_select(struct game *current_game, const int mutation_menu);
|
|
|
|
|
|
|
|
// mutation_buy : UI interface to buy mutations and see informations on them
|
|
|
|
void mutation_buy(struct game *current_game, const struct cursor c, const int mutation_menu, const int table[4][8])
|
2021-05-25 13:24:48 +02:00
|
|
|
|
|
|
|
#endif /* _PLAGUE_CORE_H */
|