Skip to main content

TownSearch

Struct TownSearch 

Source
pub struct TownSearch<'a, 'b> {
    pub town: &'a TownView<'b>,
    pub cell: &'a dyn Fn(usize) -> i32,
    pub anywhere: &'a dyn Fn(usize) -> bool,
    pub priority: &'a dyn Fn(usize) -> i32,
    pub rng: &'a mut Random,
}
Expand description

The workplace searches’ view of the town (crate::work::professions::Search).

Fields§

§town: &'a TownView<'b>

A view of the town.

§cell: &'a dyn Fn(usize) -> i32

A citizen’s map cell.

§anywhere: &'a dyn Fn(usize) -> bool

A profession works anywhere.

§priority: &'a dyn Fn(usize) -> i32

A workplace’s work priority.

§rng: &'a mut Random

The game’s random numbers.

Trait Implementations§

Source§

impl Search for TownSearch<'_, '_>

Source§

fn cell(&self, c: usize) -> i32

Citizen c’s map cell.
Source§

fn anywhere(&self, profession: usize) -> bool

Profession +0x4c (Professions::works_anywhere).
Source§

fn priority(&self, workplace: usize) -> i32

The workplace’s work priority (Jobs entry +0x24, lower first).
Source§

fn reach(&mut self, cell: i32, workplace: usize) -> bool

FUN_14011ada0: the workplace’s entrance can be reached from cell.
Source§

fn rng(&mut self) -> &mut Random

The game’s random generator (the reachability test and the hiring draw from it).

Auto Trait Implementations§

§

impl<'a, 'b> !RefUnwindSafe for TownSearch<'a, 'b>

§

impl<'a, 'b> !Send for TownSearch<'a, 'b>

§

impl<'a, 'b> !Sync for TownSearch<'a, 'b>

§

impl<'a, 'b> !UnwindSafe for TownSearch<'a, 'b>

§

impl<'a, 'b> Freeze for TownSearch<'a, 'b>

§

impl<'a, 'b> Unpin for TownSearch<'a, 'b>

§

impl<'a, 'b> UnsafeUnpin for TownSearch<'a, 'b>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.