mirror of
https://git.kittycat.homes/zoe/codename-routes.git
synced 2024-08-15 03:18:26 +00:00
eeeee
This commit is contained in:
parent
f5a5def3e3
commit
47b9179c67
7 changed files with 27 additions and 16 deletions
|
@ -4,3 +4,6 @@
|
|||
|
||||
[node name="StateServer" type="Node"]
|
||||
script = ExtResource( 1 )
|
||||
xsize = 14
|
||||
ysize = 14
|
||||
zsize = 14
|
||||
|
|
Binary file not shown.
|
@ -4,5 +4,4 @@ var server = preload("res://native/StateServer.tscn").instance()
|
|||
|
||||
func _ready():
|
||||
add_child(server)
|
||||
print(server.a)
|
||||
server.foo()
|
||||
|
|
|
@ -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]
|
||||
|
|
1
routes-native/src/stateserver/gen.rs
Normal file
1
routes-native/src/stateserver/gen.rs
Normal file
|
@ -0,0 +1 @@
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
use pathfinding::prelude::astar;
|
||||
|
||||
pub enum Path {
|
||||
|
||||
}
|
10
routes-native/src/stateserver/tiles.rs
Normal file
10
routes-native/src/stateserver/tiles.rs
Normal file
|
@ -0,0 +1,10 @@
|
|||
use gdnative::derive::{FromVariant, ToVariant};
|
||||
|
||||
#[derive(ToVariant, FromVariant)]
|
||||
pub enum Tiletypes {
|
||||
Air,
|
||||
Water,
|
||||
Grass,
|
||||
Dirt,
|
||||
Sand,
|
||||
}
|
Loading…
Reference in a new issue