pub struct EncounterEngine;Expand description
Stateless driver for the wild-encounter control flow.
Implementations§
Source§impl EncounterEngine
impl EncounterEngine
Sourcepub fn on_step<E: EncounterProvider>(
provider: &E,
map_id: u32,
x: i32,
y: i32,
mode: EncounterMode,
rng: &mut dyn BattleRng,
) -> EncounterStep<E::Species>
pub fn on_step<E: EncounterProvider>( provider: &E, map_id: u32, x: i32, y: i32, mode: EncounterMode, rng: &mut dyn BattleRng, ) -> EncounterStep<E::Species>
Call once per completed player step.
The engine checks tile eligibility, then delegates the roll to the
provider. Pure: state in, EncounterStep out, rng injected.
§Draw order
- If the tile is not encounter-eligible, returns
EncounterStep::Nonewithout consuming any RNG. - Otherwise calls
EncounterProvider::roll_encounter, which owns the entire RNG draw sequence (rate roll, slot roll, repel checks, …).
Auto Trait Implementations§
impl Freeze for EncounterEngine
impl RefUnwindSafe for EncounterEngine
impl Send for EncounterEngine
impl Sync for EncounterEngine
impl Unpin for EncounterEngine
impl UnsafeUnpin for EncounterEngine
impl UnwindSafe for EncounterEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more