-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmap.cpp
executable file
·98 lines (90 loc) · 2.63 KB
/
map.cpp
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/**************
* File Name: map.cpp
* Author: G. J. Krafsig
* Date: February 2nd, 2008
* Purpose: implementation for the map file
**************/
#include "map.h"
map::map()
{
//don't do anything
}
map::map(int character)
{
//setup all the default values based on the
//character they've selected to play the game as
switch (character)
{
case 0: //alex
landslide = "maps/alex_landslide.plex";
waterville = "maps/alex_waterville.plex";
haymarket = "maps/alex_haymarket.plex";
stonecastle = "maps/alex_stonecastle.plex";
mercyvalley = "maps/alex_mercyvalley.plex";
fuzzyland = "maps/alex_fuzzyland.plex";
wishingwellfalls = "maps/alex_wishingwellfalls.plex";
bouldercanyon = "maps/alex_lboundercanyon.plex";
merryfield = "maps/alex_merryfield.plex";
ashcanyon = "maps/alex_ashcanyon.plex";
buildersguild = "maps/alex_buildersguild.plex";
break;
case 1: //kitty
break;
case 2: //tanya
break;
case 3: //lisa
break;
case 4: //raven
break;
case 5: //bella
break;
}
}
/***********
* Purpose: return the file name for the map
* Precondition: map to lookup
* Postcondition: file name returned
***********/
bool map::getMapFilename(int map)
{
switch(map)
{
case LANDSLIDE: return landslide;
break;
case WATERVILLE: return waterville;
break;
case HAYMARKET: return haymarket;
break;
case STONECASTLE: return stonecastle;
break;
case MERCYVALLEY: return mercyvalley;
break;
case FUZZYLAND: return fuzzyland;
break;
case WISHINGWELLFALLS: return wishingwellfalls;
break;
case BOULDERCANYON: return bouldercanyon;
break;
case MERRYFIELD: return merryfield;
break;
case ASHCANYON: return ashcanyon;
break;
case BUILDERSGUILD: return buildersguild;
break;
default: return false;
break;
}
return true;
}
/***********
* Purpose: set the filename for this particular map
* Precondition: map to set, filename of the map
* Postcondition: map filename is set
***********/
int map::setMapFilename(int map, char *filename)
{
if (!map)
return 107; //error code, no map selected
if (!filename)
return 108; //no filename to set
}