This commit is contained in:
zoe 2022-05-03 21:52:38 +02:00
parent f5a5def3e3
commit 47b9179c67
7 changed files with 27 additions and 16 deletions

View file

@ -3,14 +3,9 @@ use lazy_static::lazy_static;
use pathfinding::matrix;
use tokio::sync::RwLock;
mod terrain;
mod pathing;
enum Tiles {
terrain(terrain::Terrain),
path(pathing::Path)
}
mod terrain;
mod tiles;
lazy_static! {
static ref STATE: RwLock<matrix::Matrix<Vec<terrain::Terrain>>> = RwLock::new(matrix![]);
@ -20,18 +15,26 @@ lazy_static! {
#[inherit(Node)]
pub struct StateServer {
#[property]
a: u8,
xsize: u64,
#[property]
ysize: u64,
#[property]
zsize: u64,
}
#[methods]
impl StateServer {
fn new(_owner: &Node) -> Self {
StateServer { a: 9 }
StateServer {
xsize: 14,
ysize: 14,
zsize: 14,
}
}
#[export]
fn _ready(&self, _owner: &Node) {
godot_print!("hello, uwu")
godot_print!("size: {}", self.xsize)
}
#[export]

View file

@ -0,0 +1 @@

View file

@ -1,5 +0,0 @@
use pathfinding::prelude::astar;
pub enum Path {
}

View file

@ -0,0 +1,10 @@
use gdnative::derive::{FromVariant, ToVariant};
#[derive(ToVariant, FromVariant)]
pub enum Tiletypes {
Air,
Water,
Grass,
Dirt,
Sand,
}