-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCursesView.h
More file actions
44 lines (40 loc) · 1.04 KB
/
CursesView.h
File metadata and controls
44 lines (40 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef CURSESVIEW_H
#define CURSESVIEW_H
#include "View.h"
#include <ncurses.h>
#include <string>
#include "Position.h"
#include "Frame.h"
#include "ObjectManager.h"
class CursesView: public View {
CursesView();
CursesView(const CursesView&) = delete;
CursesView& operator=(const CursesView&) = delete;
WINDOW *gameView;
WINDOW *gameBuffer1;
WINDOW *gameBuffer2;
WINDOW *statusView;
WINDOW *statusBuffer1;
WINDOW *statusBuffer2;
WINDOW *mainView;
int xdim, ydim;
static CursesView *instance;
static bool instanceFlag;
public:
static CursesView *getInstance();
bool start();
void end();
void notify(ObjectManager *objects, std::string *statuses) override;
int getY();
int getX();
void drawChar(char c, Position p);
void drawFrame(Position p, Frame f);
void drawStatus(int i, std::string s);
void swapViews();
WINDOW *getLastGameBuffer();
WINDOW *getNewGameBuffer();
WINDOW *getLastStatusBuffer();
WINDOW *getNewStatusBuffer();
void clear();
};
#endif