stratgame

diff level/src/terrain.h @ 4:cd12944a8ea8

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 25 May 2012 05:28:20 +0300
parents
children 2e38715de41b
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/level/src/terrain.h	Fri May 25 05:28:20 2012 +0300
     1.3 @@ -0,0 +1,37 @@
     1.4 +#ifndef TERRAIN_H_
     1.5 +#define TERRAIN_H_
     1.6 +
     1.7 +#include <string>
     1.8 +#include <map>
     1.9 +
    1.10 +class TerrainNode;
    1.11 +
    1.12 +class Terrain {
    1.13 +private:
    1.14 +	TerrainNode *root;
    1.15 +
    1.16 +public:
    1.17 +	Terrain();
    1.18 +	~Terrain();
    1.19 +
    1.20 +	float get_height(float x, float y) const;
    1.21 +};
    1.22 +
    1.23 +
    1.24 +class TerrainNode {
    1.25 +private:
    1.26 +	unsigned char *height;
    1.27 +
    1.28 +public:
    1.29 +	TerrainNode *child[4];
    1.30 +
    1.31 +	TerrainNode();
    1.32 +	~TerrainNode();
    1.33 +
    1.34 +	TerrainNode *get_child(float x, float y);
    1.35 +	const TerrainNode *get_child(float x, float y) const;
    1.36 +
    1.37 +	float get_height(float x, float y) const;
    1.38 +};
    1.39 +
    1.40 +#endif	// TERRAIN_H_