The Game Engine
1
Main Page
Related Pages
Classes
Files
File List
File Members
Level.h
Go to the documentation of this file.
1
#ifndef __LEVEL_H__
2
#define __LEVEL_H__
3
#include "
Sprite.h
"
4
#include "
Background.h
"
5
#include "
HUD.h
"
6
#include "
Font.h
"
7
#include "
Menu.h
"
8
#include "
ParticleSystem.h
"
9
#include "
Player.h
"
10
#include <vector>
11
#include <map>
12
#include <string>
13
14
15
using
std::vector;
16
using
std::string;
17
18
class
Text
;
19
32
class
Level
33
{
34
public
:
44
Level
(
string
name,
Condition
winCond,
Behavior
loadBehave = NULL,
45
Behavior
updateBehave = NULL,
Behavior
endBehave = NULL,
Behavior
pBehave = NULL);
46
47
~Level
();
48
52
void
drawScene
();
53
58
void
LoadBG
(
string
name);
59
63
virtual
void
postEvent
(SDL_Event event);
64
69
void
update
();
70
74
void
load
();
75
79
void
unload
();
80
85
void
addObject
(
WorldObject
* o);
86
91
void
removeObject
(
WorldObject
* o);
92
97
void
removeAllSprites
(
string
name);
98
103
void
addParticleSystem
(
ParticleSystem
* sp);
104
109
void
removeParticleSystem
(
ParticleSystem
* sp);
110
115
void
removeAllParticleSystems
(
string
name);
116
121
string
getName
() {
return
mName
; }
122
127
void
setBackground
(
Background
* b) {
128
delete
mBackground
;
129
mBackground
=b;
130
}
131
136
Background
*
getBackground
() {
return
mBackground
; }
137
143
Sprite
*
findSprite
(
string
name);
144
151
vector<Sprite*>
findSprites
(
string
name,
int
count=-1);
152
158
ParticleSystem
*
findParticleSystem
(
string
name);
159
166
vector<ParticleSystem*>
findParticleSystems
(
string
name,
int
count=-1);
167
171
bool
Loaded
;
172
176
unsigned
int
getNumPlayers
();
177
181
unsigned
int
getMaxNumPlayers
();
182
186
void
setMaxNumPlayers
(
unsigned
int
i);
187
191
Player
*
getPlayer
(
unsigned
int
index
);
192
198
bool
addPlayer
(
Player
* p);
199
205
bool
removePlayer
(
Player
* p);
206
212
int
removePlayers
(
int
count);
213
214
protected
:
// allow inheritance
218
void
DrawCollisions
();
219
223
void
DrawMenus
();
224
228
void
clearData
();
229
230
string
mName
;
232
Background
*
mBackground
;
234
vector<WorldObject*>
mWorldObjects
;
236
vector<Sprite*>
mSprites
;
238
vector<WorldObject*>
ToAdd
;
240
vector<WorldObject*>
ToRemove
;
242
vector<ParticleSystem*>
mParticleSystems
;
244
HUD
mHUD
;
245
247
Behavior
mInitialBehavior
;
249
Behavior
mMainBehavior
;
251
Behavior
mUnloadBehavior
;
253
Condition
mWinCondition
;
255
Behavior
mPauseBehavior
;
256
258
vector<Menu>
mMenus
;
259
261
vector<Player*>
mPlayers
;
262
264
unsigned
int
mMaxNumPlayers
;
265
};
266
#endif
Level.h
Generated on Tue Apr 16 2013 02:32:41 for The Game Engine by
1.8.3.1