/*---------------------------------------------------------- * HTBLA-Leonding / Klasse: 2IHIF * --------------------------------------------------------- * Exercise Number: B1 * Title: Mine Sweeper * Author: Marc Tismonar * ---------------------------------------------------------- * Description: * The Mine Sweeper Application. * ---------------------------------------------------------- */ #include #include #include #include #include "ms_game.h" #include "ms_visualizer.h" /** * Prompts the user for the mode of the game to start and returns it. */ GameMode ui_prompt_for_mode(); /** * ui_branch handles the user interface mode of the application. * @see main */ void ui_branch(GameMode mode); /** * Main function evaluates the number of command line arguments. * If the user passed one main switches into test mode, i.e., that * the function test_branch() is called and the command line argument * is handed over to this function. If no command line argument is given * main switches into user interface mode and delegates the handling * of this to the function ui_branch(). * @see ui_branch. */ int main(int argc, char *argv[]) { GC_INIT(); GameMode mode = BEGINNER; /* can be surrounded with a loop to restart the game in a different mode */ mode = ui_prompt_for_mode(); ui_branch(mode); return 0; } GameMode ui_prompt_for_mode() { /* can be extended to support interactive mode input */ return BEGINNER; } void ui_branch(GameMode mode) { /* start a new game in the given mode */ /* present the game - start the loop */ /* do { */ /* 1. ms_visualize(...) */ /* 2. ms_get_input_action() and get the game state */ /* 3. evaluate and perform the action */ /* until the action to quit the game is commanded and the game is in progress */ /* } while(action != QUIT_GAME && state == IN_PROGRESS); */ }