pub struct Storage {
pub capacity: i32,
pub accepts: u32,
pub items: Vec<Item>,
}Expand description
A storage: its capacity and the goods in it, with their reservations.
Fields§
§capacity: i32The capacity.
accepts: u32The flags of the goods it accepts.
items: Vec<Item>The goods in it.
Implementations§
Source§impl Storage
impl Storage
Sourcepub fn used(&self, materials: &[RawMaterial]) -> i32
pub fn used(&self, materials: &[RawMaterial]) -> i32
Weighted occupancy (includes reserved goods).
Original: FUN_1401323e0.
Sourcepub fn fits(
&self,
materials: &[RawMaterial],
material: usize,
count: i32,
) -> bool
pub fn fits( &self, materials: &[RawMaterial], material: usize, count: i32, ) -> bool
Whether count units of a material fit in the storage.
Original: FUN_140132250, FUN_140131a30.
Sourcepub fn available(&self, material: usize) -> i32
pub fn available(&self, material: usize) -> i32
Quantity available for another task.
Original: FUN_14011bc90.
Sourcepub fn add(&mut self, material: usize, count: i32)
pub fn add(&mut self, material: usize, count: i32)
Merge in place, otherwise append with no reservation.
Original: FUN_1401324d0.
Sourcepub fn remove(&mut self, material: usize, count: i32)
pub fn remove(&mut self, material: usize, count: i32)
Subtract, erase exactly-zero entries preserving order; no clamp.
Original: FUN_140132620.
Sourcepub fn reserve(&mut self, material: usize, count: i32)
pub fn reserve(&mut self, material: usize, count: i32)
Reserve when building a task, not on arrival.
Original: FUN_1400cb980, FUN_1400cf700.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Storage
impl RefUnwindSafe for Storage
impl Send for Storage
impl Sync for Storage
impl Unpin for Storage
impl UnsafeUnpin for Storage
impl UnwindSafe for Storage
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