-
Notifications
You must be signed in to change notification settings - Fork 0
/
chamber.h
57 lines (36 loc) · 1.02 KB
/
chamber.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
#ifndef __CHAMBER_H__
#define __CHAMBER_H__
#include <map>
#include <vector>
#include <iostream>
#include "board.h"
#include "posn.h"
#include "tile.h"
class Board;
struct Posn;
class Chamber {
Board *b; // pointer to board to get tiles
const int type; // which chamber is it?
Posn p; // chamber position on board (anchored at top left)
int numEmpty; // number of emptyTiles
int h;
int w;
// vvvv to delete later vvvv
std::map<Posn, Tile*> emptyTiles; // Posns are local to amber.
// ^^^^ to delete taler ^^^^
std::vector<Tile*> chamberTiles;
// puts empties in emptyTiles
void fillEmpties();
// checks if a tile is already in a chamber
bool notInChamber(Tile *t) const;
public:
Posn getPosn() const;
int getType() const;
int getNumEmpty() const;
Tile* getEmptyTile(Posn p);
Posn randomTile() const;
Chamber(Board *b, int type); // so it knows which chamber is being constructed
~Chamber(); // Dtor doesn't delete tiles
friend std::ostream &operator<<(std::ostream &out, const Chamber &c);
};
#endif