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


UCC Code Repository

Contents of /projects/roguelike/Terrain.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (hide annotations) (download)
Fri Apr 7 02:09:07 2006 UTC (15 years, 2 months ago) by banana
Branch: MAIN
Changes since 1.7: +6 -5 lines
File MIME type: text/plain
New class, header cleanups with pragma once

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

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26