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


UCC Code Repository

Contents of /projects/roguelike/Terrain.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (hide annotations) (download)
Thu Apr 6 15:25:10 2006 UTC (15 years, 5 months ago) by banana
Branch: MAIN
Changes since 1.6: +1 -1 lines
File MIME type: text/plain
No log message.

1 banana 1.1 /*
2     * Terrain - A part of the world
3     *
4     * Some common ids:
5     * 0: floor
6     * 1: wall
7     */
8    
9     #include "Entity.h"
10 banana 1.7 #define kMaxTerrainID 2
11 banana 1.1
12 banana 1.2 class Terrain : public Entity {
13 banana 1.3 bool opaque; //False if this terrain can be walked on/seen through
14 banana 1.1 public:
15 banana 1.2 //Terrain cache, loaded at program initialisation
16 banana 1.3 static Terrain *cache[2];
17 banana 1.2
18     //Constructor that copies a terrain out of the cache
19 banana 1.1 Terrain(int id);
20 banana 1.2
21     //Inline inherited basic-value constructor
22 banana 1.6 Terrain(std::wstring n, wchar_t s, bool o) : Entity(n, s) {
23     opaque = o;
24     }
25    
26     bool traversable() {
27     return !opaque;
28 banana 1.2 }
29 banana 1.5 };

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26