#[repr(C)]pub struct item {
pub _bitfield_align_1: [u8; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1]>,
pub held_by: u8,
pub quantity: u16,
pub id: item_id_16,
}
Fields§
§_bitfield_align_1: [u8; 0]
§_bitfield_1: __BindgenBitfieldUnit<[u8; 1]>
§held_by: u8
§quantity: u16
§id: item_id_16
Implementations§
source§impl item
impl item
sourcepub fn generate_explicit(
&mut self,
item_id: ItemId,
quantity: u16,
sticky: bool,
_ov29: OverlayLoadLease<29>
)
pub fn generate_explicit( &mut self, item_id: ItemId, quantity: u16, sticky: bool, _ov29: OverlayLoadLease<29> )
Initializes an item struct with the given information.
sourcepub fn generate(
&mut self,
item_id: ItemId,
quantity: u16,
sticky_type: Type,
_ov29: OverlayLoadLease<29>
)
pub fn generate( &mut self, item_id: ItemId, quantity: u16, sticky_type: Type, _ov29: OverlayLoadLease<29> )
Initializes an item struct with the given information.
This wraps Self::init
, but with extra logic to resolve the item’s stickiness.
It also calls Self::generate_item_quantity
for Poké.
sourcepub fn generate_item_quantity(&mut self, max_money: i32)
pub fn generate_item_quantity(&mut self, max_money: i32)
Set the quantity code on an item (assuming it’s Poké), given some maximum acceptable money amount.
source§impl item
impl item
sourcepub fn new(item_id: ItemId, quantity: u16, sticky: bool) -> Self
pub fn new(item_id: ItemId, quantity: u16, sticky: bool) -> Self
Allocates a new item.
This will resolve the quantity based on the item type:
- For Poké, the quantity code will always be set to 1.
- For thrown items, the quantity code will be randomly generated on the range of valid quantities for that item type.
- For non-stackable items, the quantity code will always be set to 0.
- Otherwise, the quantity will be assigned from the quantity argument.
sourcepub fn init(&mut self, item_id: ItemId, quantity: u16, sticky: bool)
pub fn init(&mut self, item_id: ItemId, quantity: u16, sticky: bool)
Initialize an item struct with the given information.
This will resolve the quantity based on the item type:
- For Poké, the quantity code will always be set to 1.
- For thrown items, the quantity code will be randomly generated on the range of valid quantities for that item type.
- For non-stackable items, the quantity code will always be set to 0.
- Otherwise, the quantity will be assigned from the quantity argument.
source§impl item
impl item
pub fn f_exists(&self) -> bool_
pub fn set_f_exists(&mut self, val: bool_)
pub fn f_in_shop(&self) -> bool_
pub fn set_f_in_shop(&mut self, val: bool_)
pub fn f_unpaid(&self) -> bool_
pub fn set_f_unpaid(&mut self, val: bool_)
pub fn f_sticky(&self) -> bool_
pub fn set_f_sticky(&mut self, val: bool_)
pub fn f_set(&self) -> bool_
pub fn set_f_set(&mut self, val: bool_)
pub fn flags_unk5(&self) -> u8
pub fn set_flags_unk5(&mut self, val: u8)
pub fn new_bitfield_1( f_exists: bool_, f_in_shop: bool_, f_unpaid: bool_, f_sticky: bool_, f_set: bool_, flags_unk5: u8 ) -> __BindgenBitfieldUnit<[u8; 1]>
Auto Trait Implementations§
impl RefUnwindSafe for item
impl Send for item
impl Sync for item
impl Unpin for item
impl UnwindSafe for item
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where T: CheckedCast<Dst>,
Casts the value.
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere U: From<T>,
source§impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere Dst: LosslessTryFrom<Src>,
source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Performs the conversion.
source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere Dst: LossyFrom<Src>,
source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Performs the conversion.
source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where T: OverflowingCast<Dst>,
Casts the value.
source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere Src: OverflowingCast<Dst>,
source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere T: SaturatingCast<Dst>,
Casts the value.
source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere Src: SaturatingCast<Dst>,
source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
§impl<T, U> TryFrom<U> for Twhere
U: Into<T>,
impl<T, U> TryFrom<U> for Twhere U: Into<T>,
§impl<T, U> TryInto<U> for Twhere
U: TryFrom<T>,
impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,
source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere T: UnwrappedCast<Dst>,
Casts the value.
source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere Src: UnwrappedCast<Dst>,
source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere T: WrappingCast<Dst>,
Casts the value.
source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere Src: WrappingCast<Dst>,
source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.