From 43f771fb0f19a3751875df1f25bf9cb5874f75f4 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 12 Feb 2024 21:41:49 -0800 Subject: [PATCH] updaate --- src/gameplay_modes.rs | 15 +++++++++++++-- src/model.rs | 3 +++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/gameplay_modes.rs b/src/gameplay_modes.rs index e308d7e..7b4ebb9 100644 --- a/src/gameplay_modes.rs +++ b/src/gameplay_modes.rs @@ -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_idsStageId>(&mut self,f:F){ + for (_,stage_element) in self.elements.iter_mut(){ + stage_element.stage_id=f(stage_element.stage_id); + } + } } #[derive(Default,Clone)] diff --git a/src/model.rs b/src/model.rs index 92f17cc..30d5361 100644 --- a/src/model.rs +++ b/src/model.rs @@ -32,6 +32,9 @@ impl PolygonList{ pub const fn new(list:Vec)->Self{ Self(list) } + pub fn extend>(&mut self,iter:T){ + self.0.extend(iter); + } } impl PolygonIter for PolygonList{ fn polys(&self)->impl Iterator{