fixed Distribution

This commit is contained in:
dani 2023-07-06 14:13:55 +00:00
parent 36bcdd1518
commit c18b32660a
2 changed files with 4 additions and 1 deletions

View File

@ -1,3 +1,4 @@
use rand::Rng;
use skunk2d::*;
use std::rc::Rc;
@ -12,6 +13,7 @@ struct World {
}
fn main() {
rand::thread_rng().gen::<Direction>();
run::<World>(WIDTH, HEIGHT);
}

View File

@ -1,4 +1,5 @@
use crate::{Image, Tileset, Vec2};
use rand::distributions::Standard;
use rand::prelude::Distribution;
use rand::Rng;
use std::rc::Rc;
@ -128,7 +129,7 @@ impl HexMap {
}
}
impl Distribution<Direction> for Direction {
impl Distribution<Direction> for Standard {
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Direction {
match rng.gen_range(0..6) {
0 => Direction::North,