|
|
|
@ -31,24 +31,12 @@ void GUI::output(const string msg) { |
|
|
|
|
_lines.push_back(msg); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int GUI::main_loop(GameEngine &game, Builder &builder) { |
|
|
|
|
auto gui = SFMLBackend(game); |
|
|
|
|
|
|
|
|
|
gui.startup(); |
|
|
|
|
|
|
|
|
|
while(gui.is_open()) { |
|
|
|
|
builder.event(BuildEvent::GO); |
|
|
|
|
void GUI::main_loop(SFMLBackend &gui) { |
|
|
|
|
gui.handle_events(); |
|
|
|
|
gui.update_entities(); |
|
|
|
|
gui.update_log(_lines); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
builder.event(BuildEvent::QUIT); |
|
|
|
|
|
|
|
|
|
gui.shutdown(); |
|
|
|
|
return EXIT_SUCCESS; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void GUI::build_works() { |
|
|
|
|
building_sound.stop(); |
|
|
|
|
build_works_sound.play(); |
|
|
|
|