-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLocation.cc
67 lines (60 loc) · 1.58 KB
/
Location.cc
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include "Location.hh"
Location::Location(const Location& other) :
back(NULL), front(NULL),
hasMine(other.hasMine),selected(other.selected),
measured(other.measured),adjacentMines(other.adjacentMines),
user(other.user), help(other.help)
{
// DEBUG cout << "C"; cout.flush();
}
Location& Location::operator=(const Location& other) {
if( this != &other ) {
// back=NULL;
// front=NULL;
hasMine=other.hasMine;
selected=other.selected;
measured=other.measured;
adjacentMines=other.adjacentMines;
user=other.user;
help=other.help;
// DEBUG cout << "A"; cout.flush();
};
return *this;
}
Location::Location() : back(NULL),front(NULL),hasMine(false),
selected(false),measured(false),adjacentMines(0),
user(NOTHING), help(NONE)
{
// DEBUG cout << "N"; cout.flush();
}
Location::~Location() {
// DEBUG cout << "D"; cout.flush();
if (back) {
delete back;
back=NULL;
};
if (front) {
front->destroy();
front=NULL;
};
}
void Location::reset() {
// ignore the back tiles
// just delete the front pixmap
if (NULL!=front) {
front->destroy();
front=NULL;
};
hasMine=false;
selected=false;
measured=false;
adjacentMines=0;
user=NOTHING;
help=NONE;
}
/*
$Header: /home/ckuklewicz/cvsroot/gminehunter/Location.cc,v 2.2 2000/07/24 03:57:04 ckuklewicz Exp $
$Log: Location.cc,v $
Revision 2.2 2000/07/24 03:57:04 ckuklewicz
Compile cleanly under -Wall
*/