mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
clean up
This commit is contained in:
parent
7a1218cf2f
commit
8c5901516e
@ -882,31 +882,7 @@ impl TradePricing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn get_materials_impl(&self, item: &ItemDefinitionId) -> Option<MaterialUse> {
|
fn get_materials_impl(&self, item: &ItemDefinitionId) -> Option<MaterialUse> {
|
||||||
//let tmp = format!("{:?}", item);
|
self.price_lookup(&item.to_owned()).cloned()
|
||||||
let ret = self.price_lookup(&item.to_owned()).cloned();
|
|
||||||
// match item {
|
|
||||||
// ItemDefinitionIdOwned::Simple(id) => self.price_lookup(id).cloned(),
|
|
||||||
// ItemDefinitionIdOwned::Modular { components, .. } => Some(
|
|
||||||
// components
|
|
||||||
// .into_iter()
|
|
||||||
// .filter_map(|comp| self.get_materials_impl(comp))
|
|
||||||
// .sum(),
|
|
||||||
// ),
|
|
||||||
// ItemDefinitionIdOwned::Compound {
|
|
||||||
// simple_base,
|
|
||||||
// components,
|
|
||||||
// } => Some(
|
|
||||||
// self.price_lookup(simple_base)
|
|
||||||
// .cloned()
|
|
||||||
// .unwrap_or_else(MaterialUse::default)
|
|
||||||
// + components
|
|
||||||
// .into_iter()
|
|
||||||
// .filter_map(|comp| self.get_materials_impl(comp))
|
|
||||||
// .sum(),
|
|
||||||
// ),
|
|
||||||
// };
|
|
||||||
println!("{:?} -> {:?}", item, ret);
|
|
||||||
ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
@ -1023,34 +999,6 @@ pub fn expand_loot_table(loot_table: &str) -> Vec<(f32, ItemDefinitionIdOwned, f
|
|||||||
ProbabilityFile::from(vec![(1.0, LootSpec::LootTable(loot_table.into()))]).content
|
ProbabilityFile::from(vec![(1.0, LootSpec::LootTable(loot_table.into()))]).content
|
||||||
}
|
}
|
||||||
|
|
||||||
// pub fn item_from_definition_id(id: &ItemDefinitionIdOwned) -> Item {
|
|
||||||
// match id {
|
|
||||||
// ItemDefinitionIdOwned::Simple(str) =>
|
|
||||||
// Item::new_from_asset_expect(str), ItemDefinitionIdOwned::Modular {
|
|
||||||
// pseudo_base:_,
|
|
||||||
// components:_,
|
|
||||||
// } => todo!(),
|
|
||||||
// ItemDefinitionIdOwned::Compound {
|
|
||||||
// simple_base,
|
|
||||||
// components,
|
|
||||||
// } => {
|
|
||||||
// warn!("simple_base {}", simple_base);
|
|
||||||
// let ability_map = &AbilityMap::load().read();
|
|
||||||
// let msm = &MaterialStatManifest::load().read();
|
|
||||||
// let components = components
|
|
||||||
// .iter()
|
|
||||||
// .map(|i| item_from_definition_id(i))
|
|
||||||
// .collect();
|
|
||||||
// Item::new_from_item_base(
|
|
||||||
// ItemBase::Modular(ModularBase::Tool),
|
|
||||||
// components,
|
|
||||||
// ability_map,
|
|
||||||
// msm,
|
|
||||||
// )
|
|
||||||
// },
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if you want to take a look at the calculated values run:
|
// if you want to take a look at the calculated values run:
|
||||||
// cd common && cargo test trade_pricing -- --nocapture
|
// cd common && cargo test trade_pricing -- --nocapture
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
Loading…
Reference in New Issue
Block a user