From 36ee60306751d61bec1cd8ea04783d9f04023b5d Mon Sep 17 00:00:00 2001 From: Roman Khaliavka Date: Thu, 1 May 2025 16:01:01 +0000 Subject: [PATCH] a4 --- a4/world.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 a4/world.h diff --git a/a4/world.h b/a4/world.h new file mode 100644 index 0000000..e695ff2 --- /dev/null +++ b/a4/world.h @@ -0,0 +1,38 @@ +#ifndef _WORLD_H_ +#define _WORLD_H_ +#define COLOR_COUNT 8 + +#include + +enum event_type { + EVENT_START, + EVENT_TIMEOUT, + EVENT_KEY, + EVENT_MOUSE, + EVENT_RESIZE, + EVENT_ESC, + EVENT_END, +}; + +struct event { + int width; + int height; + int key; + int alt_key; + enum event_type type; + int mouse_x; + int mouse_y; + int mouse_left; + int mouse_right; + int mouse_middle; + long int time_ms; +}; + +void set_cell(int character, int x, int y); +void set_color_cell(int character, int x, int y, short front_color, short back_color); +int start_world(void* (*init_game)(), int (*world_event)(struct event*, void*), void (*destroy_game)(void*)); +void game_speed(int value); +void set_message(const char* message, int x, int y); +void clear_screen(); + +#endif \ No newline at end of file