DungeonCrawl
|
Implements the main game loop and state handling for DungeonCrawl. More...
#include "game.h"
#include "character/character.h"
#include "combat/combat_mode.h"
#include "database/database.h"
#include "database/game/character_database.h"
#include "database/game/gamestate_database.h"
#include "game_data.h"
#include "inventory/inventory_mode.h"
#include "io/input/input_types.h"
#include "io/io_handler.h"
#include "io/output/common/output_handler.h"
#include "logging/logger.h"
#include "map/map.h"
#include "map/map_generator.h"
#include "map/map_mode.h"
#include "menu/main_menu.h"
#include "menu/save_menu.h"
#include "src/common.h"
#include "stats/stats_mode.h"
#include <locale.h>
#include <stdbool.h>
#include <stdio.h>
Go to the source code of this file.
Functions | |
void | game_loop () |
The main game loop of the application. | |
void | combat_mode_state () |
The state machine for the combat mode. | |
void | stats_mode_state () |
Handles the stats mode state of the game. | |
int | loading_game (int game_state_id, player_pos_setter_t setter) |
Load the a game from the database. | |
void | run_game () |
Starts the game loop. | |
void | main_menu_state () |
Handles the main menu state of the game. | |
void | map_mode_state () |
Handles the map mode state of the game. | |
void | loot_mode_state () |
Handles the loot mode state of the game. | |
void | inventory_mode_state () |
Handles the inventory mode state of the game. |
Variables | |
db_connection_t | db_connection |
bool | game_in_progress |
game_state_t | current_state |
int | exit_code |
Implements the main game loop and state handling for DungeonCrawl.
Definition in file game.c.
void combat_mode_state | ( | ) |
The state machine for the combat mode.
The state machine of the combat mode.
Definition at line 220 of file game.c.
void game_loop | ( | ) |
The main game loop of the application.
Definition at line 70 of file game.c.
void inventory_mode_state | ( | ) |
Handles the inventory mode state of the game.
This function manages the interactions and transitions that occur within the inventory mode, including item management, usage, and equipping items.
Definition at line 249 of file game.c.
int loading_game | ( | int | game_state_id, |
player_pos_setter_t | setter ) |
Load the a game from the database.
game_state_id | The id of the game state to be loaded. |
setter | A setter for the player position. |
Definition at line 272 of file game.c.
void loot_mode_state | ( | ) |
Handles the loot mode state of the game.
This function manages the interactions and transitions that occur when the player is looting after a combat encounter, including selecting items to take and managing inventory.
Definition at line 238 of file game.c.
void main_menu_state | ( | ) |
Handles the main menu state of the game.
This function manages the interactions and transitions that occur within the main menu, including starting a new game, loading a game, and changing settings.
Definition at line 115 of file game.c.
void map_mode_state | ( | ) |
Handles the map mode state of the game.
This function manages the interactions and transitions that occur within the map mode, including player movement, map exploration, and interactions with map elements.
Definition at line 186 of file game.c.
void run_game | ( | ) |
Starts the game loop.
This function initializes and runs the main game loop, handling the various game states and transitions until the game is exited.
void stats_mode_state | ( | ) |
Handles the stats mode state of the game.
The state machine for the stats mode.
This function manages the interactions and transitions that occur within the stats mode, including displaying player stats and managing skill points.
Definition at line 262 of file game.c.
db_connection_t db_connection |