-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGameMap.h
66 lines (55 loc) · 1.33 KB
/
GameMap.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
#pragma once
#ifndef GAMEMAP_H_
#define GAMEMAP_H_
#include "Square.h"
#include "SquareList.h"
class GameMap
{
private:
enum GameMode {NOMODE = -1,EASYMODE = 0,MEDIUMMODE = 1,HARDMODE = 2,DEFAULTMODE = 3};
enum Mode {EASY = 9,MEDIUM = 16,HARD =30};
enum Number {EASYNUM = 10,MEDIUMNUM = 40,HARDNUM = 99};
Square*** _Sq; //三级指针
int _GameCount; //游戏次数
int _WinCount; //胜利次数
int _Width; //地图宽度
int _Length; //地图长度
int _Mode; //当前难度
int _BombNumber;//地雷数量
friend class SquareList;
public:
//构造函数
GameMap();
GameMap(const int& _M);
GameMap(const int& _W, const int& _L, const int& _N);
//析构函数
~GameMap();
//主动销毁地图
void DeleteMap();
//构造地图
void CreateMap(const int& m); //Easy,Medium,Hard
void CreateMap(const int& _W, const int& _L, const int& _N); //Custom
//放置地雷
void PutBomb();
//显示地图
void ShowMap();
//SL地图
void SaveMap();
void LoadMap();
//点亮格子
void LightS(int i,int j);
//标记格子
void MarkS(int i, int j);
//检测点亮数量
bool Count();
//显示地图属性
const int& ShowGameCount() const;
int& ShowGameCount();
const int& ShowWinCount() const;
int& ShowWinCount();
const int& ShowMode() const;
const int& ShowLength() const;
const int& ShowWidth() const;
const int& ShowBombNumber() const;
};
#endif