This commit is contained in:
Quaternions 2024-02-12 21:41:49 -08:00
parent d31dcd0b19
commit 43f771fb0f
2 changed files with 16 additions and 2 deletions

View File

@ -11,9 +11,9 @@ pub struct StageElement{
}
impl StageElement{
#[inline]
pub const fn new(stage_id:u32,force:bool,behaviour:StageElementBehaviour)->Self{
pub const fn new(stage_id:StageId,force:bool,behaviour:StageElementBehaviour)->Self{
Self{
stage_id:StageId(stage_id),
stage_id,
force,
behaviour,
}
@ -141,6 +141,12 @@ impl Mode{
jump_limit:HashMap::new(),
}
}
pub const fn get_start(&self)->ModelId{
self.start
}
pub const fn get_style(&self)->&gameplay_style::StyleModifiers{
&self.style
}
pub fn push_stage(&mut self,stage:Stage){
self.stages.push(stage)
}
@ -231,6 +237,11 @@ impl ModeUpdate{
mu.jump_limit.insert(model_id,jump_limit);
mu
}
pub fn map_stage_element_ids<F:Fn(StageId)->StageId>(&mut self,f:F){
for (_,stage_element) in self.elements.iter_mut(){
stage_element.stage_id=f(stage_element.stage_id);
}
}
}
#[derive(Default,Clone)]

View File

@ -32,6 +32,9 @@ impl PolygonList{
pub const fn new(list:Vec<IndexedVertexList>)->Self{
Self(list)
}
pub fn extend<T:IntoIterator<Item=IndexedVertexList>>(&mut self,iter:T){
self.0.extend(iter);
}
}
impl PolygonIter for PolygonList{
fn polys(&self)->impl Iterator<Item=&[VertexId]>{