MCPcopy Create free account
hub / github.com/davemoore22/sorcery / start

Method start

src/modules/remove.cpp:48–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46
47 return true;
48}
49
50auto 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();

Callers

nothing calls this directly

Calls 8

go_toMethod · 0.80
check_for_abortMethod · 0.80
check_for_resizeMethod · 0.80
check_for_backMethod · 0.80
tickMethod · 0.80
wantsMethod · 0.80
initialiseMethod · 0.45
displayMethod · 0.45

Tested by

no test coverage detected