-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCDiscMinesweeper.h
More file actions
68 lines (49 loc) · 1.7 KB
/
Copy pathCDiscMinesweeper.h
File metadata and controls
68 lines (49 loc) · 1.7 KB
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
#ifndef CDiscMINESWEEPER_H
#define CDiscMINESWEEPER_H
//------------------------------------------------------------------------
//
// Name: CMineSweeper.h
//
// Author: Mat Buckland 2002
//
// Desc: Class to create a minesweeper object
//
//------------------------------------------------------------------------
#include <vector>
#include <math.h>
#include "utils.h"
#include "C2DMatrix.h"
#include "SVector2D.h"
#include "CParams.h"
#include "CDiscCollisionObject.h"
#include "CMinesweeper.h"
using namespace std;
enum ROTATION_DIRECTION {NORTH=1, SOUTH=3, EAST=0, WEST=2};
class CDiscMinesweeper:public CMinesweeper
{
private:
//its position in the world
SVector2D<int> m_vPosition;
SVector2D<int> m_vPrevPosition;
//direction sweeper is facing
SVector2D<int> m_vLookAt;
//its rotation (surprise surprise)
ROTATION_DIRECTION m_dRotation;
//sets the internal closest object variables for the 3 types of objects
void GetClosestObjects(vector<CDiscCollisionObject*> &objects);
public:
void setRotation(ROTATION_DIRECTION rotForce);
ROTATION_DIRECTION getRotation();
CDiscMinesweeper();
//updates the information from the sweepers enviroment
bool Update(vector<CDiscCollisionObject*> &objects);
//used to transform the sweepers vertices prior to rendering
void WorldTransform(vector<SPoint> &sweeper);
//checks to see if the minesweeper has 'collected' a mine
int CheckForObject(vector<CDiscCollisionObject*> &objects, int size);
void Reset();
//-------------------accessor functions
SVector2D<int> Position()const{return SVector2D<int>(m_vPosition.x,m_vPosition.y);}
SVector2D<int> PrevPosition()const{return SVector2D<int>(m_vPrevPosition.x,m_vPrevPosition.y);}
};
#endif