diff options
author | Nao Pross <naopross@thearcway.org> | 2017-11-25 20:02:46 +0100 |
---|---|---|
committer | Nao Pross <naopross@thearcway.org> | 2017-11-25 20:02:46 +0100 |
commit | 004fa309d6ede28ec8ab195647a2cbee490e104f (patch) | |
tree | 77caa08e70ba6ad02e3af0f143f3c5a24970ccd5 /src/ui/AsciiRenderer.h | |
download | OrbitingYeti-004fa309d6ede28ec8ab195647a2cbee490e104f.tar.gz OrbitingYeti-004fa309d6ede28ec8ab195647a2cbee490e104f.zip |
First commit
Diffstat (limited to '')
-rw-r--r-- | src/ui/AsciiRenderer.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/ui/AsciiRenderer.h b/src/ui/AsciiRenderer.h new file mode 100644 index 0000000..4f9020a --- /dev/null +++ b/src/ui/AsciiRenderer.h @@ -0,0 +1,33 @@ +/* + * Renderer.h + * + * Created on: Nov 23, 2017 + * Author: naopross + */ + +#ifndef SRC_UI_ASCIIRENDERER_H_ +#define SRC_UI_ASCIIRENDERER_H_ + +#include "../diagram/Structogram.h" + +namespace samb { + +class AsciiRenderer { +private: + Structogram m_structogram; + const unsigned int m_width; + + void drawPadding(unsigned int amt); + void drawLine() const; + void drawText(std::string text, unsigned int width = 0, std::string before = "|", std::string after = "|") const; + void drawDecision(std::string condition, std::string trueText, std::string falseText, unsigned int width = 0) const; +public: + AsciiRenderer(Structogram& structogram, unsigned int width); + ~AsciiRenderer(); + + void render(); +}; + +} /* namespace samb */ + +#endif /* SRC_UI_ASCIIRENDERER_H_ */ |