generated from tipragot/rust
Add a renderer system with temp assets #60
|
@ -28,7 +28,7 @@ pub struct StartMapGeneration {
|
|||
pub seed: u32,
|
||||
|
||||
/// The radius of the map.
|
||||
pub radius: usize,
|
||||
pub radius: u16,
|
||||
}
|
||||
|
||||
/// An event send when the map is generated.
|
||||
|
@ -41,12 +41,12 @@ fn generate_map(
|
|||
mut end_map_event: EventWriter<EndMapGeneration>,
|
||||
mut commands: Commands,
|
||||
mut noise: Local<Option<Perlin>>,
|
||||
mut map_iterator: Local<Option<HexSpiral<isize>>>,
|
||||
mut map_iterator: Local<Option<HexSpiral<i32>>>,
|
||||
) {
|
||||
// Handle map generation events.
|
||||
for event in event.read() {
|
||||
*noise = Some(Perlin::new(event.seed));
|
||||
*map_iterator = Some(HexPosition(0, 0).spiral(event.radius));
|
||||
*map_iterator = Some(HexPosition(0, 0).spiral(event.radius as usize));
|
||||
}
|
||||
|
||||
if let (Some(perlin), Some(spiral)) = (noise.as_ref(), map_iterator.as_mut()) {
|
||||
|
|
Loading…
Reference in a new issue