Skip to main content

StorageGeometry

Struct StorageGeometry 

Source
pub struct StorageGeometry<'a, 'b> {
    pub town: &'a TownView<'b>,
    pub sectors: &'a mut SectorGraph,
    pub ground: &'a dyn Fn(i32) -> [f32; 3],
}
Expand description

The geometry called by the town’s storage search. Uses the same sector cache as the AI.

Fields§

§town: &'a TownView<'b>

A view of the town.

§sectors: &'a mut SectorGraph

The sector graph.

§ground: &'a dyn Fn(i32) -> [f32; 3]

The ground point of a cell.

Trait Implementations§

Source§

impl StorageSearchMap for StorageGeometry<'_, '_>

Source§

fn rank(&mut self, a: i32, b: i32) -> i32

FUN_140008830: path rank, or map width plus truncated Euclidean cell distance.

Source§

fn market_position( &mut self, entity: usize, from: i32, rng: &mut Random, ) -> Option<(i32, [f32; 3])>

Port of FUN_14004f710: draw a use point (including Rand(1)), then test reachability.

Source§

fn storage_position( &mut self, entity: usize, from: i32, ) -> Option<(i32, [f32; 3])>

Port of FUN_140132aa0: nearest reachable use point, or scan the grown map rectangle. The rectangle branch includes one extra row at its upper end, as the x64 loop does.

Source§

fn entrance(&mut self, entity: usize, rng: &mut Random) -> i32

The cell a citizen walks to at an entity.

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

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

§

impl<'a, 'b> UnsafeUnpin for StorageGeometry<'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.