thrive/01_text_adventure/game.h

34 lines
569 B
C
Raw Normal View History

2025-01-02 20:57:00 -05:00
#ifndef _FD_GAME_
#define _FD_GAME_
2025-01-04 04:45:44 -05:00
typedef struct Game Game;
2025-01-04 05:28:46 -05:00
#include <stdbool.h>
2025-01-03 20:58:02 -05:00
#include "input.h"
#include "room.h"
#include "log.h"
2025-01-02 20:57:00 -05:00
2025-01-04 04:45:44 -05:00
struct Game {
bool should_close;
2025-01-03 20:58:02 -05:00
Input *input;
Log *log;
2025-01-04 04:45:44 -05:00
Rooms rooms;
Room *current_room;
2025-01-03 20:58:02 -05:00
};
2025-01-02 20:57:00 -05:00
2025-01-04 05:28:46 -05:00
typedef enum Command {
COMMAND_LOOK,
COMMAND_QUIT,
COMMAND_UNKNOWN,
} Command;
2025-01-04 04:45:44 -05:00
Game *game_create(void);
void game_handle_command(Game *g, const char *command);
void game_load_rooms(Game *g);
void game_run_until_close(Game *g);
void game_handle_input(Game *g);
void game_draw(Game *g);
void free_game(Game *g);
2025-01-03 21:07:44 -05:00
2025-01-02 20:57:00 -05:00
#endif