From 9f6bdf6851ad38a9cea1e3edc6c3a375c60e2aed Mon Sep 17 00:00:00 2001 From: Djeeberjr Date: Tue, 21 Mar 2023 01:10:58 +0100 Subject: [PATCH] removed unused TermIO class --- src/lib/TermIO.hx | 51 ----------------------------------------------- 1 file changed, 51 deletions(-) delete mode 100644 src/lib/TermIO.hx diff --git a/src/lib/TermIO.hx b/src/lib/TermIO.hx deleted file mode 100644 index 3ba86f8..0000000 --- a/src/lib/TermIO.hx +++ /dev/null @@ -1,51 +0,0 @@ -package lib; - -import lib.Color; -import kernel.ui.TermWriteable; - -/** - Helpfull class for writing onto a `TermWriteable`. -**/ -class TermIO { - private var output:TermWriteable; - - public function new(output:TermWriteable) { - this.output = output; - - output.reset(); - output.setCursorPos(0, 0); - } - - public function writeLn(text:String, ?textColor:Color) { - if (textColor != null) { - output.setTextColor(textColor); - } - - var size = output.getSize(); - var cPos = output.getCursorPos(); - - if (cPos.y >= size.y){ - newLine(); - } - - for (i in 0...Math.floor(text.length / size.x) + 1) { - output.write(text.substr(i * size.x, size.x)); - newLine(); - } - - if (textColor != null) { - output.setTextColor(White); - } - } - - private function newLine() { - var cPos = output.getCursorPos(); - - if (cPos.y == output.getSize().y) { - output.scroll(1); - output.setCursorPos(0, cPos.y - 1); - } else { - output.setCursorPos(0, cPos.y + 1); - } - } -}