-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstage.h
39 lines (29 loc) · 812 Bytes
/
stage.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
#ifndef __stage_h__
#define __stage_h__
#include <list>
#include <vector>
#include "geometry.h"
class Stage {
public:
Stage();
Stage(const char* filename);
~Stage();
const std::list<Rect*> &get_geometry() const;
const Rect &get_bounds() const;
const Rect &get_goal() const;
const Vec2 &get_origin() const;
int at_goal(const Vec2 &position) const;
// line impact and collision point
std::auto_ptr<std::pair<Line, Vec2> > collide_line(const Line &in) const;
std::auto_ptr<Vec2> collide_corner(const Line &in) const;
private:
Rect bounds;
Rect goal;
std::list<Rect*> geometry;
Vec2 origin;
void generate_border();
void generate_climb();
void load_stage(const char*filename);
std::auto_ptr<std::vector<Line> > block_borders(Rect &in) const;
};
#endif // __stage_h__