File: level.h

package info (click to toggle)
epiphany 0.5.1-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,540 kB
  • ctags: 593
  • sloc: cpp: 4,223; makefile: 80; sh: 11
file content (78 lines) | stat: -rw-r--r-- 2,550 bytes parent folder | download | duplicates (2)
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
/***************************************************************************
                          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 as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#include "dephine.h"
#include "direction.h"
#include "entity_type.h"
#include "spriteset.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<Ntt_pointer> m_entities_list;
	std::vector<std::vector<int> > m_entities_matrix;
	Entity_Player* m_player;
	Entity_Exit* m_exit;
	Spriteset& m_spriteset;
	Sampleset& m_sampleset;
	unsigned int m_acquired_keys;
	unsigned int m_min_score;
	unsigned int m_max_time;
	void set_entity(Entity*);
public:
	Level(Spriteset& sprites, Sampleset& samples);
	int get_entity_id(int x, int y);
	int get_entity_id(int x, int y, Direction d);
	Entity_Player& get_player();
	Ntt_pointer& get_entity(int ntt_id);
	Ntt_pointer& get_entity(int x, int y);
	Ntt_pointer& get_entity(int x, int y, Direction d);
	void load_map(const char* path);
	int get_size_x();
	int get_size_y();
//	void set_player(Entity_Player*);

	void set_entity(Entity_Type type, unsigned int x, unsigned int y);
	Sprite& get_sprite(Entity*);
	std::vector<Ntt_pointer>& get_entities_list();
	std::vector<std::vector<int> >& get_entities_matrix();
	void set_key(unsigned int);
	unsigned int get_acquired_keys();
	Sprite& get_sprite(Entity_Type entity_type);
	Sample* get_sample(Sample_Type sample_type);
	~Level();
	void explode(unsigned int x, unsigned int y, Entity_Type transform_to=UNKNOWN);
	unsigned int get_min_score();
	unsigned int get_max_time();
};

#endif //LEVEL_H