aboutsummaryrefslogtreecommitdiffstats
path: root/src/world.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/world.cpp')
-rw-r--r--src/world.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/world.cpp b/src/world.cpp
index 63769a9..9e289ea 100644
--- a/src/world.cpp
+++ b/src/world.cpp
@@ -26,11 +26,34 @@
World::World(sol::object ref)
{
if (ref.get_type() == sol::type::table) {
-
+ sol::table tab = ref;
+ if (tab["Seed"] == sol::type::number) {
+ seed = tab["Seed"];
+ }
+ if (tab["Layers"] == sol::type::number) {
+ layers = tab["Layers"];
+ }
+ if (tab["Generate"] == sol::type::function) {
+ generate = tab["Generate"];
+ }
} else {
// TODO better logging
std::cerr << "World paramaters must be stored in a table" << std::endl;
}
+ generate(this);
+}
+
+void World::setData(unsigned int x,
+ unsigned int y,
+ unsigned int z,
+ unsigned int d)
+{
+ (void)x;
+ (void)y;
+ (void)z;
+ (void)d;
+
+ // TODO actually do stuff here
}