|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef UTILITIES_H
|
|
#define UTILITIES_H
|
|
|
|
#include <windows.h>
|
|
#include <conio.h>
|
|
#include "Size.h"
|
|
using namespace std;
|
|
|
|
#define FOREGROUND_WHITE FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY
|
|
#define FOREGROUND_YELLOW FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY
|
|
#define BACKGROUND_WHITE BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE | BACKGROUND_INTENSITY
|
|
|
|
class Utilities
|
|
{
|
|
private:
|
|
HANDLE hConsole;
|
|
public:
|
|
Utilities();
|
|
void initScreen();
|
|
int nonblockingGetch();
|
|
int checkKey();
|
|
void getWindowSize(Size&);
|
|
void clearConsole();
|
|
void gotoXY(int x, int y);
|
|
void changeColour(WORD colour);
|
|
};
|
|
|
|
#endif |