-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlevelobjects.h
76 lines (58 loc) · 1.91 KB
/
levelobjects.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
67
68
69
70
71
72
73
74
75
76
#ifndef _LEVELOBJECTS_H_
#define _LEVELOBJECTS_H_
#include <fstream>
#include <string>
#include "levelentities.h"
#include <vector>
#include "point.h"
#include "resourcemgr.h"
#include "physics.h"
#include "filenames.h"
#include "object.h"
using namespace std;
class LevelObjects
{
public:
// Constructor and Deconstructor
LevelObjects();
~LevelObjects();
ResourceMgr* resourceMgr;
// Memeber Functions
void insert( Detectable* o );
void remove( Detectable* o );
void clear();
// Load object types and locations from a file
void loadObjects( const string filename );
// Master detection function
void didDetect( Physics* o );
// Draw function
void draw();
protected:
//Vectors hold all the Level Entities objects
vector < Detectable* > objectBin;
// To read in objects from file
ifstream objectLoader;
// Functions to access the object file
void openFile( const string fileName );
void readIn();
// To clear ifstreams buffer and close the file.
void doneLoading();
// Load level object images for current level
void loadImages();
//detection functions
void objectsFromLeft ( Physics* o );
void objectsFromRight ( Physics* o );
void objectsFromTop ( Physics* o );
void objectsFromBottom( Physics* o );
void objectsFromTopAndLeft ( Physics* o );
void objectsFromTopAndRight ( Physics* o );
void objectsFromBottomAndLeft ( Physics* o );
void objectsFromBottomAndRight( Physics* o );
//Seperate draw functions
void drawWall ( LevelEntities* );
void drawLedge ( LevelEntities* );
void drawPlatform( LevelEntities* );
void drawBlock ( LevelEntities* );
void drawPillar ( LevelEntities* );
};
#endif