-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCell.h
76 lines (53 loc) · 1.25 KB
/
Cell.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
Arsh Chauhan and Tristan Craddick
02/24/2016
Last Edited: 03/10/2016
Header for class Cell
*/
#ifndef CELL_H_INCLUDED
#define CELL_H_INCLUDED
#include <tuple>
using std::tuple;
class Cell
{
public:
bool isOccupied();
bool isHead();
bool isHit();
bool isMiss();
bool isSunk();
bool isTarSunk();
void setOccupied();
void setHead();
void removeHead();
void removeOccupied();
void setMiss(); //if a spot that isn't occupied is hit
void setHit(); //if a spot that is occupied is hit
void setSunk();
void setTarSunk();
tuple<float,float,float,float> getBounds();
void setBounds(float,float,float,float);
bool getSquareHover();
void setSquareHover(bool);
int getID();
void setID(int num);
private:
bool isHead_;
bool isOccupied_;
bool isHit_;
bool isMiss_;
bool isSunk_;
bool isTarSunk_;
bool squareHover_; //whether the mouse is over the cell
float bottomBound_;
float topBound_;
float leftBound_;
float rightBound_;
int ship_ID;
/********************************Constructors**************************/
public:
//Default ctor
//Cell is neither ccupied nor a head by default
Cell():isHead_(false),isOccupied_(false),isHit_(false),isMiss_(false),isSunk_(false),isTarSunk_(false),squareHover_(false),ship_ID(-1){};
};
#endif