File: level.h

package info (click to toggle)
epiphany 0.7.0+0-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 7,532 kB
  • sloc: cpp: 6,404; ansic: 141; makefile: 78; sh: 7
file content (89 lines) | stat: -rw-r--r-- 2,158 bytes parent folder | download | duplicates (6)
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
/***************************************************************************
                          level.h  -  description
                             -------------------
    begin                : Fri Aug 31 2001
    copyright            : (C) 2001 by Giuseppe D'Aqu�
    email                : kumber@tiscalinet.it
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License, Version 2, as published by  *
 *   the Free Software Foundation.                                   *
 *                                                                         *
 ***************************************************************************/

#include "dephine.h"
#include "direction.h"
#include "entity_type.h"
#include "entity_manager.h"
#include <vector>
#include "sfx.h"


#ifndef LEVEL_H
#define LEVEL_H

class Entity;
class Ntt_pointer;

class Screen;
class Sprite;
class Entity_Player;
class Entity_Exit;


class Level
{
private:


	
	std::vector<std::vector<Entity_Handle> > m_entities_matrix;
	Entity_Player* m_player;
	Entity_Exit* m_exit;

	Uint32 m_acquired_keys;
	Uint32 m_min_score;
	Uint32 m_max_time;
	void set_entity(Entity*);

public:
	Level();
	
	Entity_Player& get_player();
	
	Entity_Handle get_entity(Sint32 x, Sint32 y);
	
	Entity_Handle get_entity(Sint32 x, Sint32 y, Direction d);
	
	Entity_Handle get_entity(Sint32 x, Sint32 y, Direction d, Direction d1);
	
	void load_map(const char* path);
	
	Uint32 get_size_x();
	
	Uint32 get_size_y();

	void set_entity(Entity_Type type, Uint32 x, Uint32 y);

	std::vector<std::vector<Entity_Handle> >& get_entities_matrix();

	void set_key(Uint32);

	Uint32 get_acquired_keys();

	~Level();

	void explode(Uint32 x, Uint32 y, Entity_Type transform_to=UNKNOWN);

	Uint32 get_min_score();

	Uint32 get_max_time();
	
	bool player_push(Uint32 x, Uint32 y, Direction d);

};

#endif //LEVEL_H