summaryrefslogtreecommitdiff
path: root/dungeon/src/entity.rs
diff options
context:
space:
mode:
Diffstat (limited to 'dungeon/src/entity.rs')
-rw-r--r--dungeon/src/entity.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/dungeon/src/entity.rs b/dungeon/src/entity.rs
index b290a2f..3a8f131 100644
--- a/dungeon/src/entity.rs
+++ b/dungeon/src/entity.rs
@@ -2,13 +2,14 @@
use std::mem::take;
-use rand::{Rng, rngs::SmallRng};
+use rand::Rng;
use crate::{
Dungeon, astar, const_pos,
map::Floor,
player_input::PlayerInput,
pos::{Direction, FPos, Pos},
+ rng::DungeonRng,
};
/// `PLAYER_FULL_HEALTH` is the starting health of the player entity
@@ -97,7 +98,7 @@ impl EnemyMoveState {
///
/// Will randomly pick a direction and number of tiles within roaming range to move.
/// If an invalid tile is selected 50 times in a row, `EnemyMoveState::Idle` is returned instead.
- pub fn roam(starting_pos: Pos, floor: &Floor, rng: &mut SmallRng) -> Self {
+ pub fn roam(starting_pos: Pos, floor: &Floor, rng: &mut DungeonRng) -> Self {
let mut loop_index = 0;
loop {
let dir = rng.random();
@@ -274,7 +275,7 @@ impl Default for Player {
struct Updater<'a> {
floor: &'a Floor,
- rng: &'a mut SmallRng,
+ rng: &'a mut DungeonRng,
player_pos: Pos,
input: PlayerInput,
delta_time: f32,