[][src]Struct sulis_state::MerchantState

pub struct MerchantState {
    pub id: String,
    pub buy_frac: f32,
    pub sell_frac: f32,
    pub listeners: ChangeListenerList<MerchantState>,
    pub loot_list_id: Option<String>,
    pub refresh_rate_millis: usize,
    pub last_refresh_millis: usize,
    // some fields omitted
}

Fields

id: Stringbuy_frac: f32sell_frac: f32listeners: ChangeListenerList<MerchantState>loot_list_id: Option<String>refresh_rate_millis: usizelast_refresh_millis: usize

Implementations

impl MerchantState[src]

pub fn load(save: MerchantSaveState) -> Result<MerchantState, Error>[src]

pub fn new(
    id: &str,
    loot_list: &Rc<LootList>,
    buy_frac: f32,
    sell_frac: f32,
    refresh_time: Time
) -> MerchantState
[src]

pub fn check_refresh(&mut self)[src]

pub fn get_buy_price(&self, item_state: &ItemState) -> i32[src]

pub fn get_sell_price(&self, item_state: &ItemState) -> i32[src]

pub fn add(&mut self, item_state: ItemState)[src]

pub fn remove(&mut self, index: usize) -> Option<ItemState>[src]

removes one copy of the item at the specified index

pub fn items(&self) -> &ItemList[src]

Auto Trait Implementations

impl !RefUnwindSafe for MerchantState

impl !Send for MerchantState

impl !Sync for MerchantState

impl Unpin for MerchantState

impl !UnwindSafe for MerchantState

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]