collapse this struct

This commit is contained in:
Quaternions 2024-02-04 22:41:45 -08:00
parent f7b774c050
commit 78686b449d
2 changed files with 4 additions and 23 deletions

View File

@ -1,10 +1,13 @@
use std::collections::HashMap;
use crate::model; use crate::model;
use crate::gameplay_modes; use crate::gameplay_modes;
use crate::gameplay_attributes; use crate::gameplay_attributes;
//this is the current map data loaded in memory //this is the current map data loaded in memory
pub struct Map{ pub struct Map{
pub modes:gameplay_modes::Modes, 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>, pub attributes:Vec<gameplay_attributes::CollisionAttributes>,
//RenderPattern //RenderPattern
pub textures:Vec<Vec<u8>>, pub textures:Vec<Vec<u8>>,

View File

@ -160,25 +160,3 @@ pub struct Model{
pub color:Color4,//transparency is in here pub color:Color4,//transparency is in here
pub transform:Planar64Affine3, 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);
}
}