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 <cstdlib>
#include "src/out_api/init.hpp"
int main() {
init::begin();
for (; !init::stop();) {
init::step();
}
init::end();
}

View file

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

View file

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

View file

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

View file

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