/[anoncvs]/projects/roguelike/World.h


UCC Code Repository

Contents of /projects/roguelike/World.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (show annotations) (download)
Sat Apr 15 15:02:52 2006 UTC (15 years ago) by banana
Branch: MAIN
CVS Tags: HEAD
Changes since 1.11: +0 -1 lines
File MIME type: text/plain
Windows frontend finished (though it is rudimentary)

1 /*
2 * World - A level or area
3 */
4 #pragma once
5
6 //Includes
7 #include <vector>
8 #include <string>
9 #include <list>
10 #include "Terrain.h"
11 #include "Character.h"
12 #include "Player.h"
13 #include "fov.h"
14
15 //Class definition
16 class World {
17 std::wstring name;
18 int width, height;
19 unsigned long time;
20
21 fov_settings_type libfov_settings;
22
23 std::vector<std::vector<bool> > memoryCache;
24 std::vector<std::vector<bool> > LOSCache;
25 std::vector<std::vector<Terrain*> > terrains;
26 std::vector<std::vector<Character*> > characters;
27 std::list<Character*> actors;
28
29 void init();
30
31 void initLOSCache();
32 void updateLOSCache();
33
34 public:
35 int px, py;
36
37 //A datatype for representing a map square
38 struct location {
39 bool los; //Does the player have Line Of Sight to this square?
40 bool memory;//Does the player remember this square?
41 Terrain *terrain;
42 Character *character;
43 };
44
45 World(int x = 80, int y = 24);
46 World::World(std::wstring n, int x, int y, std::vector<std::vector<int> > &t);
47
48 int getWidth();
49 int getHeight();
50 location at(int x, int y);
51
52 void add(Character *c, int x, int y);
53 void add(Player *c, int x, int y);
54 void remove(int x, int y);
55 void remember(int x, int y);
56
57 void move(Character *c, int x, int y);
58 void act();
59
60 ~World();
61 };

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26