22 lines
354 B
C++
22 lines
354 B
C++
#pragma once
|
|
|
|
#include <array>
|
|
#include <string>
|
|
#include <ncurses.h>
|
|
|
|
class Engine {
|
|
public:
|
|
Engine();
|
|
~Engine() { endwin(); }
|
|
void run();
|
|
|
|
private:
|
|
char p1 { 'x' }, p2 { 'o' }, temp { p1 };
|
|
std::string status;
|
|
std::array<char, 9> view;
|
|
void draw_display() const;
|
|
bool check_line(char id) const;
|
|
bool update_status();
|
|
bool process_input();
|
|
};
|