Created the generator hierarchy

This commit is contained in:
Kayne Ruse
2014-06-21 06:47:30 +10:00
parent d3bf099a98
commit 924ebc2ee9
20 changed files with 475 additions and 39 deletions
+3 -17
View File
@@ -22,31 +22,17 @@
#ifndef OVERWORLDGENERATOR_HPP_
#define OVERWORLDGENERATOR_HPP_
#include "chunk_data.hpp"
#include "lua/lua.hpp"
#include "base_generator.hpp"
#define OVERWORLD_GENERATOR_PSEUDOINDEX "OverworldGenerator"
constexpr int OVERWORLD_WIDTH = 256;
constexpr int OVERWORLD_HEIGHT = 256;
//TODO: SuperGenerator API
//TODO: SuperGenerator DOCS
class OverworldGenerator {
class OverworldGenerator : public BaseGenerator {
public:
OverworldGenerator();
~OverworldGenerator();
//accessors and mutators
ChunkData* GetChunk(int x, int y) { return &chunks[x][y]; }
lua_State* SetLuaState(lua_State* L) { return luaState = L; }
lua_State* GetLuaState() { return luaState; }
private:
ChunkData chunks[OVERWORLD_WIDTH][OVERWORLD_HEIGHT];
lua_State* luaState = nullptr;
//
};
#endif