-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathConsoleFrame.h
34 lines (28 loc) · 972 Bytes
/
ConsoleFrame.h
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
#pragma once
#include <vector>
#include <string>
#include "Cell.h"
class ConsoleRenderer;
class ConsoleFrame
{
public:
ConsoleFrame(int x, int y, int width, int height);
~ConsoleFrame() = default;
void Clear();
const Cell& GetCell(int x, int y) const;
void SetCell(int x, int y, const Cell& cell);
void DrawRectangle(int x, int y, int width, int height, const Cell& borderCell);
void FillRectangle(int x, int y, int width, int height, const Cell& fillCell);
void SetText(int x, int y, const std::wstring& text,
WORD CollorAttr = static_cast<WORD>(ConsoleColor::BrightWhite));
int GetX() const;
int GetY() const;
int GetWidth() const;
int GetHeight() const;
protected:
int mX; // 콘솔 상에서 Frame의 시작 X 좌표
int mY; // 콘솔 상에서 Frame의 시작 Y 좌표
int mWidth; // Frame 너비
int mHeight; // Frame 높이
std::vector<Cell> mCells; // Frame 내부의 Cell 배열
};