use strafesnet_common::model::{TextureId,RenderConfigId,RenderConfig}; #[derive(Clone)] pub enum Texture{ ImageDDS(Vec), } impl AsRef<[u8]> for Texture{ fn as_ref(&self)->&[u8]{ match self{ Texture::ImageDDS(data)=>data.as_ref(), } } } pub struct RenderConfigs{ textures:Vec>, render_configs:Vec, } impl RenderConfigs{ pub(crate) const fn new(textures:Vec>,render_configs:Vec)->Self{ Self{ textures, render_configs, } } pub fn consume(self)->( impl Iterator, impl Iterator ){ ( self.textures.into_iter().enumerate().filter_map(|(texture_id,maybe_texture)| maybe_texture.map(|texture|(TextureId::new(texture_id as u32),texture)) ), self.render_configs.into_iter().enumerate().map(|(render_id,render)| (RenderConfigId::new(render_id as u32),render) ), ) } }