feat: input_tile and players

This commit is contained in:
DarthMooMancer
2025-09-05 21:50:49 -04:00
parent 4ce29c2b14
commit 54d78ef6c0
9 changed files with 148 additions and 7 deletions
+30 -4
View File
@@ -1,7 +1,8 @@
#include "input.hpp"
#include <iostream>
#include <ncurses.h>
#include "input.hpp"
void Input::get_input(bool &running) {
void Input::get_input(bool &running, Player &one, Player &two, std::vector<Point> &points) {
while(running) {
initscr();
cbreak();
@@ -10,8 +11,33 @@ void Input::get_input(bool &running) {
_getch = getch();
endwin();
if(_getch == 113) {
running = false;
switch (_getch) {
case 49:
one.input_tile(0, points);
break;
case 50:
one.input_tile(1, points);
break;
case 51:
one.input_tile(2, points);
break;
case 52:
one.input_tile(3, points);
break;
case 53:
one.input_tile(4, points);
break;
case 54:
one.input_tile(5, points);
break;
case 55:
one.input_tile(6, points);
break;
case 113:
running = false;
break;
default:
_getch = 0;
}
}
}