| 46 | |
| 47 | return true; |
| 48 | } |
| 49 | |
| 50 | auto Sorcery::Remove::start() -> int { |
| 51 | |
| 52 | _ctx.controller->go_to(Enums::Screen::REMOVE); |
| 53 | _ctx.controller->initialise(); |
| 54 | |
| 55 | // Main loop |
| 56 | auto done{false}; |
| 57 | while (!done) { |
| 58 | |
| 59 | SDL_Event event; |
| 60 | while (SDL_PollEvent(&event)) { |
| 61 | |
| 62 | // Check for Quit Events |
| 63 | ImGui_ImplSDL2_ProcessEvent(&event); |
| 64 | done = _ctx.controller->check_for_abort(event); |
| 65 | |
| 66 | // Check for Window Resize |
| 67 | _ctx.controller->check_for_resize(event, _ctx.ui); |
| 68 | |
| 69 | // Check for Back Event |
| 70 | if (_ctx.controller->check_for_back(event)) |
| 71 | return BACK_FROM_ROSTER; |
| 72 | |
| 73 | // Check for Quicksave and Quickload |
| 74 | if (_ctx.controller->check_for_quicksave(event)) |
| 75 | _ctx.application->save_state_to_binary( |
| 76 | _ctx.get_file(SAVE_STATE_FILENAME)); |
| 77 | else if (_ctx.controller->check_for_quickload(event)) { |
| 78 | _ctx.application->load_state_from_binary( |
| 79 | _ctx.get_file(SAVE_STATE_FILENAME)); |
| 80 | continue; |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | _ctx.ui->display(Enums::Screen::REMOVE, _ctx.game); |
| 85 | _ctx.tick(); |
nothing calls this directly
no test coverage detected