From d608bef678fa97b3af910fa62598c55f33650825 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Tom=C3=A1s?= Date: Fri, 17 Jul 2020 16:23:43 -0300 Subject: Restructure source files --- src/client/cursor.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/client/cursor.cpp (limited to 'src/client/cursor.cpp') diff --git a/src/client/cursor.cpp b/src/client/cursor.cpp new file mode 100644 index 0000000..4e76151 --- /dev/null +++ b/src/client/cursor.cpp @@ -0,0 +1,13 @@ +struct Cursor { + int x; + int y; + Window *w; + + void move_left() { + if (x > 0) x--; + } + + void move_right() { + if (x < w->width - 1 && w->pos(x + 1, y) != 0) x++; + } +}; -- cgit v1.2.3