mirror of
https://github.com/ProgramSnail/rts_game_backend.git
synced 2026-01-12 22:47:14 +00:00
added stop function
This commit is contained in:
parent
5173f4f2a9
commit
9be0f50790
5 changed files with 21 additions and 1 deletions
7
main.cpp
7
main.cpp
|
|
@ -1,6 +1,11 @@
|
|||
#include <curses.h>
|
||||
#include <cstdlib>
|
||||
#include "src/out_api/init.hpp"
|
||||
|
||||
int main() {
|
||||
|
||||
init::begin();
|
||||
for (; !init::stop();) {
|
||||
init::step();
|
||||
}
|
||||
init::end();
|
||||
}
|
||||
|
|
@ -14,6 +14,10 @@ namespace init {
|
|||
input::begin();
|
||||
}
|
||||
|
||||
bool stop() {
|
||||
return input::stop();
|
||||
}
|
||||
|
||||
void step() {
|
||||
draw::step();
|
||||
usleep(STEP_DELAY_USEC);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ namespace init {
|
|||
|
||||
void begin();
|
||||
|
||||
bool stop();
|
||||
|
||||
void step();
|
||||
|
||||
void end();
|
||||
|
|
|
|||
|
|
@ -3,10 +3,17 @@
|
|||
#include "input.hpp"
|
||||
|
||||
namespace input {
|
||||
|
||||
bool stopValue = false;
|
||||
|
||||
void begin() {
|
||||
|
||||
}
|
||||
|
||||
bool stop() {
|
||||
return stopValue;
|
||||
}
|
||||
|
||||
void step() {
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ namespace input {
|
|||
|
||||
void begin();
|
||||
|
||||
bool stop();
|
||||
|
||||
void step();
|
||||
|
||||
void end();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue