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


UCC Code Repository

Diff of /projects/roguelike/Terrain.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by banana, Wed Apr 5 13:02:43 2006 UTC revision 1.9 by banana, Sun Apr 9 07:17:22 2006 UTC
# Line 1  Line 1 
1  /*  /*
2   *  Terrain - A part of the world   *  Terrain - the details of a location on the map
  *  
  * Some common ids:  
  * 0: floor  
  * 1: wall  
3   */   */
4    #pragma once
5    
6    //Includes
7  #include "Entity.h"  #include "Entity.h"
 #define kMaxTerrainID 1  
8    
9    //This is a hack :/
10    #define kMaxTerrainID 2
11    
12    //Class definition
13  class Terrain : public Entity {  class Terrain : public Entity {
14          bool opaque; //False if this terrain can be walked on/seen through          bool opaque; //False if this terrain can be walked on/seen through
15  public:  public:
# Line 19  public: Line 20  public:
20          Terrain(int id);          Terrain(int id);
21                    
22          //Inline inherited basic-value constructor          //Inline inherited basic-value constructor
23          Terrain(std::wstring n, wchar_t s) : Entity(n, s) {          Terrain(std::wstring n, wchar_t s, unsigned int c, bool o) : Entity(n, s, c) {
24                  opaque = false;                  opaque = o;
25            }
26            
27            bool traversable() {
28                    return !opaque;
29          }          }
 };  
30    };

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.9

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26