mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
refactor code to be smaller and clearer
This commit is contained in:
parent
6b42b1c762
commit
83a4454be5
@ -96,8 +96,9 @@ impl Asset for StructuresSpec {
|
||||
}
|
||||
}
|
||||
|
||||
fn convert(specifications: &StructuresSpec) -> Vec<Arc<Structure>> {
|
||||
return specifications
|
||||
fn load_structures(specifier: &str) -> Vec<Arc<Structure>> {
|
||||
let spec = assets::load::<StructuresSpec>(&["world.manifests.", specifier].concat());
|
||||
return spec.unwrap()
|
||||
.0
|
||||
.iter()
|
||||
.map(|sp| {
|
||||
@ -109,12 +110,6 @@ fn convert(specifications: &StructuresSpec) -> Vec<Arc<Structure>> {
|
||||
.collect();
|
||||
}
|
||||
|
||||
fn load_structures(specifier: &str) -> Vec<Arc<Structure>> {
|
||||
dbg!(specifier);
|
||||
let spec = assets::load::<StructuresSpec>(&["world.manifests.", specifier].concat());
|
||||
return convert(&spec.unwrap());
|
||||
}
|
||||
|
||||
lazy_static! {
|
||||
pub static ref OAKS: Vec<Arc<Structure>> = load_structures("oaks");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user