Plague-fx/src/core.h

85 lines
1.9 KiB
C

#ifndef _PLAGUE_CORE_H
#define _PLAGUE_CORE_H
// Duration for internal clock
#define ENGINE_TICK 50
#define CURSOR_TICK 100
// 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;
// Coordinates of the plane's departure
int depa_x, depa_y;
};
//cursor : cursor information for mutations selection
struct cursor
{
// Cursor's coordinates
int x, y;
// If the cursor should be displayed
int display;
};
// 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);
// rtc_key : get the key with RTC system
int rtc_key(void);
// callback_timer : basic timer
int callback_tick(volatile int *tick);
// 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]);
#endif /* _PLAGUE_CORE_H */