Fully working wrappers

This commit is contained in:
Rendo 2026-04-05 22:02:45 +05:00
commit a57bdc52d0
5 changed files with 92 additions and 28 deletions

View file

@ -15,7 +15,7 @@ pub struct Gene {
pub place: GenePlace,
pub kind: GeneType,
pub sprite: Option<String>,
pub get_child_position: fn(GeneType) -> Vector2
pub get_child_position: fn(GenePlace) -> Vector2
}
impl Gene {
@ -28,7 +28,7 @@ impl Gene {
get_child_position: |_| Vector2::ZERO,
}
}
pub fn structural(plant_source: GeneSource, place: GenePlace, kind: GeneType, get_child_position: fn(GeneType) -> Vector2) -> Self {
pub fn structural(plant_source: GeneSource, place: GenePlace, kind: GeneType, get_child_position: fn(GenePlace) -> Vector2) -> Self {
Self {
plant_source,
place,
@ -46,7 +46,7 @@ impl Gene {
get_child_position: |_| Vector2::ZERO,
}
}
pub fn new(plant_source: GeneSource, place: GenePlace, kind: GeneType, sprite: String, get_child_position: fn(GeneType) -> Vector2) -> Self {
pub fn new(plant_source: GeneSource, place: GenePlace, kind: GeneType, sprite: String, get_child_position: fn(GenePlace) -> Vector2) -> Self {
Self {
plant_source,
place,