diff --git a/godot/native/libroutes_native.so b/godot/native/libroutes_native.so index 5976607..28240ad 100755 Binary files a/godot/native/libroutes_native.so and b/godot/native/libroutes_native.so differ diff --git a/routes-native/src/stateserver.rs b/routes-native/src/stateserver.rs index a8a04a8..28b3110 100644 --- a/routes-native/src/stateserver.rs +++ b/routes-native/src/stateserver.rs @@ -2,7 +2,6 @@ use gdnative::prelude::*; use self::gen::GameRng; -mod saves; mod world; mod gen; @@ -23,16 +22,6 @@ impl StateServer { } } - #[export] - fn load_from_file(&self, _owner: &Node, file: GodotString) { - saves::load(&file.to_string()); - } - - #[export] - fn save_from_file(&self, _owner: &Node, file: GodotString) { - saves::save(&file.to_string()); - } - #[export] fn _ready(&self, _owner: &Node) {} @@ -63,6 +52,16 @@ impl StateServer { fn is_tile_hidden(&self, _owner: &Node, x: usize, y: usize, z: usize) -> bool { self.world.is_tile_hidden(x, y, z) } + + #[export] + fn can_put_tile_at(&self, _owner: &Node, x: usize, y: usize, z: usize, id: usize) -> bool{ + self.world.can_put_tile_at(x, y, z, id) + } + + #[export] + fn put_tile_at(&mut self, _owner: &Node, x: usize, y: usize, z: usize, id: usize){ + self.world.put_tile_at(x, y, z, id); + } } // signals diff --git a/routes-native/src/stateserver/saves.rs b/routes-native/src/stateserver/saves.rs deleted file mode 100644 index da80bd1..0000000 --- a/routes-native/src/stateserver/saves.rs +++ /dev/null @@ -1,9 +0,0 @@ -use toml; - -pub fn load (file: &str){ - -} - -pub fn save (file: &str){ - -} diff --git a/routes-native/src/stateserver/world.rs b/routes-native/src/stateserver/world.rs index 8ccead0..c36e6ed 100644 --- a/routes-native/src/stateserver/world.rs +++ b/routes-native/src/stateserver/world.rs @@ -90,6 +90,15 @@ impl World { positions } + pub fn put_tile_at(&mut self, x: usize, y: usize, z: usize, id: usize){ + + } + + pub fn can_put_tile_at(&self, x: usize, y: usize, z: usize, id: usize) -> bool{ + false + } + + pub fn new(xsize: usize, ysize: usize, zsize: usize) -> World { World { xsize,