rename MoveState::changed to apply_enum

This commit is contained in:
Quaternions 2024-02-21 22:07:05 -08:00
parent f027594ab4
commit d2a864e2c1

View File

@ -489,7 +489,7 @@ enum MoveState{
} }
impl MoveState{ impl MoveState{
//call this after state.move_state is changed //call this after state.move_state is changed
fn changed(&self,body:&mut Body,touching:&TouchingState,models:&PhysicsModels,hitbox_mesh:&HitboxMesh,style:&StyleModifiers,camera:&PhysicsCamera,input_state:&InputState){ fn apply_enum(&self,body:&mut Body,touching:&TouchingState,models:&PhysicsModels,hitbox_mesh:&HitboxMesh,style:&StyleModifiers,camera:&PhysicsCamera,input_state:&InputState){
match self{ match self{
MoveState::Fly=>body.acceleration=Planar64Vec3::ZERO, MoveState::Fly=>body.acceleration=Planar64Vec3::ZERO,
MoveState::Air=>{ MoveState::Air=>{
@ -956,7 +956,7 @@ impl PhysicsState {
self.move_state.next_move_instruction(&self.style.strafe,self.time) self.move_state.next_move_instruction(&self.style.strafe,self.time)
} }
fn set_move_state(&mut self,data:&PhysicsData,move_state:MoveState){ fn set_move_state(&mut self,data:&PhysicsData,move_state:MoveState){
move_state.changed(&mut self.body,&self.touching,&data.models,&data.hitbox_mesh,&self.style,&self.camera,&self.input_state); move_state.apply_enum(&mut self.body,&self.touching,&data.models,&data.hitbox_mesh,&self.style,&self.camera,&self.input_state);
self.move_state=move_state; self.move_state=move_state;
} }