wrapper pt1

This commit is contained in:
Rendo 2026-04-02 00:32:52 +05:00
commit 219fc97519
6 changed files with 58 additions and 4 deletions

View file

@ -0,0 +1,34 @@
use godot::prelude::*;
use godot::classes::{Node,INode};
use crate::genetics::genome::Genome;
#[derive(GodotConvert, Var, Export, Default, Clone)]
#[godot(via = GString)]
pub enum PlantType {
#[default] // Rust standard attribute, not godot-rust.
None,
Peashooter,
Sunflower,
}
#[derive(GodotClass)]
#[class(base=Node)]
struct GodotGenome {
#[export]
from_plant: PlantType,
genome: Genome,
base: Base<Node>
}
#[godot_api]
impl INode for GodotGenome {
fn init(base: Base<Node>) -> Self {
Self {
from_plant: PlantType::None,
genome: Genome::new(),
base
}
}
}