-
Notifications
You must be signed in to change notification settings - Fork 1
/
Point.h
45 lines (29 loc) · 959 Bytes
/
Point.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
35
36
37
38
39
40
41
42
43
44
45
#pragma once
#include "gotoxy.h"
#include <iostream>
#include <Windows.h>
using namespace std;
enum eKEYS {LEFT = 'a', RIGHT = 'd', HARD_DOWN = 'x', ROUTE = 'w', JSTOP = 's', DEFAULT = ' ', ESC = 27};
class Point
{
//Date members
int x;
int y;
bool busy;
char ch;
int serialNumber;
public:
//ctor
Point(int _x, int _y, bool _busy = false, char _ch = '#') : x(_x) ,y(_y), busy(_busy), ch(_ch) {};
Point() {}; // empty constructor
void setPoint(int _x, int _y, bool _busy = false, int _serialNumber = 0, char _ch = '#') { x = _x; y = _y; busy = _busy; serialNumber = _serialNumber; ch = _ch; }
void setSerialNumber(int _serialNumber) { serialNumber = _serialNumber; }
char getSign() const{ return ch; };
//draw
void draw(char ch = '#')const;
// get data members of the class
int getx() { return x; }
int gety() { return y; }
bool isBusy() const { return busy; }
int getSerialNumber()const { return serialNumber; }
};