collapse this struct
This commit is contained in:
parent
f7b774c050
commit
78686b449d
@ -1,10 +1,13 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use crate::model;
|
||||
use crate::gameplay_modes;
|
||||
use crate::gameplay_attributes;
|
||||
//this is the current map data loaded in memory
|
||||
pub struct Map{
|
||||
pub modes:gameplay_modes::Modes,
|
||||
pub models:model::Models,
|
||||
pub indexed_models:HashMap<model::IndexedModelId,model::IndexedModel>,
|
||||
pub models:HashMap<model::ModelId,model::Model>,
|
||||
pub attributes:Vec<gameplay_attributes::CollisionAttributes>,
|
||||
//RenderPattern
|
||||
pub textures:Vec<Vec<u8>>,
|
||||
|
22
src/model.rs
22
src/model.rs
@ -160,25 +160,3 @@ pub struct Model{
|
||||
pub color:Color4,//transparency is in here
|
||||
pub transform:Planar64Affine3,
|
||||
}
|
||||
|
||||
pub struct Models{
|
||||
pub indexed_models:HashMap<IndexedModelId,IndexedModel>,
|
||||
pub models:HashMap<ModelId,Model>,
|
||||
}
|
||||
impl Models{
|
||||
pub fn new(
|
||||
indexed_models:HashMap<IndexedModelId,IndexedModel>,
|
||||
models:HashMap<ModelId,Model>,
|
||||
)->Self{
|
||||
Self{
|
||||
indexed_models,
|
||||
models,
|
||||
}
|
||||
}
|
||||
}
|
||||
impl Updatable<Models> for Models{
|
||||
fn update(&mut self,update:Models){
|
||||
self.indexed_models.extend(update.indexed_models);
|
||||
self.models.extend(update.models);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user