-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpeice.cpp
More file actions
34 lines (27 loc) · 778 Bytes
/
peice.cpp
File metadata and controls
34 lines (27 loc) · 778 Bytes
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
#include "peice.h"
// peice generic code..........
bool peice::canMove(Point p) {
return true;
}
void peice::onCreate() {
width = boxColSize;
height = boxRowSize;
sprite = new char*[height];
for(int i=0;i<height;i++)
sprite[i] = new char[width];
strncpy(sprite[0], "|-------|", width);
strncpy(sprite[1], "| |", width);
strncpy(sprite[2], "| peice |", width);
strncpy(sprite[3], "|-------|", width);
}
void peice::setPlayerId(int Id) { playerId = Id; }
int peice::getPlayerId() { return playerId; }
void peice::setLocation(Point p) {
location = p;
set(location.x*width, location.y*height); // set x y location of entity for printing......
}
Point peice::getLocation() {
return location;
}
peice::~peice() { }
char peice::getPeiceId() { return 'x'; }