added stop function

This commit is contained in:
ProgramSnail 2021-03-23 00:30:28 +03:00
parent 5173f4f2a9
commit 9be0f50790
5 changed files with 21 additions and 1 deletions

View file

@ -1,6 +1,11 @@
#include <curses.h> #include <curses.h>
#include <cstdlib> #include <cstdlib>
#include "src/out_api/init.hpp"
int main() { int main() {
init::begin();
for (; !init::stop();) {
init::step();
}
init::end();
} }

View file

@ -14,6 +14,10 @@ namespace init {
input::begin(); input::begin();
} }
bool stop() {
return input::stop();
}
void step() { void step() {
draw::step(); draw::step();
usleep(STEP_DELAY_USEC); usleep(STEP_DELAY_USEC);

View file

@ -8,6 +8,8 @@ namespace init {
void begin(); void begin();
bool stop();
void step(); void step();
void end(); void end();

View file

@ -3,10 +3,17 @@
#include "input.hpp" #include "input.hpp"
namespace input { namespace input {
bool stopValue = false;
void begin() { void begin() {
} }
bool stop() {
return stopValue;
}
void step() { void step() {
} }

View file

@ -6,6 +6,8 @@ namespace input {
void begin(); void begin();
bool stop();
void step(); void step();
void end(); void end();