From 05750c44046f320109055aa5954ef0bbd977705f Mon Sep 17 00:00:00 2001 From: Joursoir Date: Thu, 10 Dec 2020 16:02:46 +0000 Subject: refactor clui: delete class ChatRoom, create own class for chat, players, tips (new), input --- src/client/clui/WindowInterface.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/client/clui/WindowInterface.cpp (limited to 'src/client/clui/WindowInterface.cpp') diff --git a/src/client/clui/WindowInterface.cpp b/src/client/clui/WindowInterface.cpp new file mode 100644 index 0000000..336d3b1 --- /dev/null +++ b/src/client/clui/WindowInterface.cpp @@ -0,0 +1,33 @@ +#include "WindowInterface.hpp" + +WindowInterface::WindowInterface(int num_y, int num_x, int by, + int bx, char ch) + : ny(num_y), nx(num_x), beg_y(by), beg_x(bx), ch_line(ch) +{ + w = newwin(ny, nx, beg_y, beg_x); + box(w, ch_line, ch_line); + Update(); +} +WindowInterface::~WindowInterface() +{ + Clear(true); + Update(); + delwin(w); +} + +void WindowInterface::SetCursor(int y, int x) +{ + wmove(w, y, x); +} + +void WindowInterface::Clear(bool full) +{ + werase(this->GetWindow()); + if(!full) + box(this->GetWindow(), ch_line, ch_line); +} + +void WindowInterface::Update() +{ + wrefresh(w); +} \ No newline at end of file -- cgit v1.2.3-18-g5258