allow replace existing stage

This commit is contained in:
Quaternions 2024-02-15 00:47:09 -08:00
parent 261e42c33d
commit ece055db6f

View File

@ -125,7 +125,7 @@ impl ModesBuilder{
assert!(self.modes.insert(mode_id,mode).is_none(),"Cannot replace existing mode");
}
fn insert_stage(&mut self,mode_id:gameplay_modes::ModeId,stage_id:gameplay_modes::StageId,stage:gameplay_modes::Stage){
assert!(self.stages.entry(mode_id).or_insert(HashMap::new()).insert(stage_id,stage).is_none(),"Cannot replace existing stage");
self.stages.entry(mode_id).or_insert(HashMap::new()).insert(stage_id,stage);//assert!(.is_none(),"Cannot replace existing stage");
}
fn push_mode_update(&mut self,mode_id:gameplay_modes::ModeId,mode_update:gameplay_modes::ModeUpdate){
self.mode_updates.push((mode_id,mode_update));