Struct veloren_common::comp::inventory::trade_pricing::TradePricing
source · pub struct TradePricing {
items: PriceEntries,
equality_set: EqualitySet,
}
Fields§
§items: PriceEntries
§equality_set: EqualitySet
Implementations§
source§impl TradePricing
impl TradePricing
const COIN_ITEM: &'static str = "common.items.utility.coins"
const CRAFTING_FACTOR: f32 = 0.949999988f32
const INVEST_FACTOR: f32 = 0.330000013f32
fn good_from_item(name: &ItemDefinitionIdOwned) -> Good
fn price_lookup( &self, requested_name: &ItemDefinitionIdOwned ) -> Option<&MaterialUse>
fn calculate_material_cost(&self, r: &RememberedRecipe) -> Option<MaterialUse>
fn calculate_material_cost_sum(&self, r: &RememberedRecipe) -> Option<f32>
fn sort_by_price(&self, recipes: &mut [RememberedRecipe]) -> bool
fn read() -> Self
fn random_items_impl( &self, stockmap: &mut HashMap<Good, f32>, number: u32, selling: bool, always_coin: bool, limit: u32 ) -> Vec<(ItemDefinitionIdOwned, u32)>
fn get_materials_impl(&self, item: &ItemDefinitionId<'_>) -> Option<MaterialUse>
pub fn random_items( stock: &mut HashMap<Good, f32>, number: u32, selling: bool, always_coin: bool, limit: u32 ) -> Vec<(ItemDefinitionIdOwned, u32)>
pub fn get_materials(item: &ItemDefinitionId<'_>) -> Option<MaterialUse>
Trait Implementations§
source§impl Debug for TradePricing
impl Debug for TradePricing
source§impl Default for TradePricing
impl Default for TradePricing
source§fn default() -> TradePricing
fn default() -> TradePricing
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for TradePricing
impl Send for TradePricing
impl Sync for TradePricing
impl Unpin for TradePricing
impl UnwindSafe for TradePricing
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<Context> SubContext<Context> for Context
impl<Context> SubContext<Context> for Context
fn sub_context(self) -> Context
§impl<T> TryDefault for Twhere
T: Default,
impl<T> TryDefault for Twhere
T: Default,
§fn try_default() -> Result<T, String>
fn try_default() -> Result<T, String>
Tries to create the default.
§fn unwrap_default() -> Self
fn unwrap_default() -> Self
Calls
try_default
and panics on an error case.