Hex table

This commit is contained in:
2026-06-22 11:37:35 +03:00
parent eda216b85d
commit 74f01cf895
6 changed files with 162 additions and 29 deletions
+4 -3
View File
@@ -11,7 +11,7 @@ use rand::RngExt;
use rand_chacha::ChaCha8Rng;
use rayon::prelude::IntoParallelIterator;
use crate::seed_automation::SeedAutomation;
use crate::subplate_automation::SubPlateAutomation;
use crate::subplate_automation::{HexMatrixRequest, SubPlateAutomation};
use rayon::iter::ParallelIterator;
pub fn update_automation_view(
@@ -64,11 +64,12 @@ pub fn update_automation(
if keys.just_pressed(KeyCode::Enter) {
println!("Switching to SubPlateAutomation");
let mut new_table = Table::<Color>::new(Color::BLACK, automation.world.side);
automation.world.convert_copy(&mut new_table, |value| { if value { Color::WHITE } else { Color::BLACK } });
let mut new_table = Table::<Color>::new(Color::NONE, automation.world.side);
automation.world.convert_copy(&mut new_table, |value| { if value { Color::WHITE } else { Color::NONE} });
commands.entity(entity).remove::<PlateAutomation>().insert(SubPlateAutomation{
world: new_table
});
commands.spawn((HexMatrixRequest));
}
}