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


UCC Code Repository

Contents of /projects/roguelike/Terrain.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Thu Apr 13 07:12:10 2006 UTC (15 years ago) by banana
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +1 -1 lines
Newlines at ends of files

1 //Includes
2 #include "Terrain.h"
3 #include "port.h"
4
5 //Terrain cache storage
6 Terrain *Terrain::cache[2];
7
8 //Load terrain from data/terrain/id
9 Terrain::Terrain(int id) {
10 //As this was already done at startup, we just have to copy the values
11 name = cache[id]->name;
12 symbol = cache[id]->symbol;
13 colour = cache[id]->colour;
14 opaque = cache[id]->opaque;
15 }
16
17 bool Terrain::traversable() {
18 return !opaque;
19 }
20
21 bool Terrain::transparent() {
22 return !opaque;
23 }
24
25 bool Terrain::memorable() {
26 return (symbol == L'#');
27 }

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26