From ec161531640d37aa85e35c2770f333cb2c628fdf Mon Sep 17 00:00:00 2001 From: timokoesters Date: Wed, 17 Apr 2019 22:32:36 +0200 Subject: [PATCH] Rename animationHistory to animation_history Former-commit-id: bb2c882332fa9c3fd7f2c7fbd6143cd5f85153d8 --- client/src/lib.rs | 10 +++++----- common/src/msg/server.rs | 2 +- server/src/lib.rs | 16 ++++++++-------- voxygen/src/scene/figure.rs | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/client/src/lib.rs b/client/src/lib.rs index 53d47a7084..4931912b66 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -168,9 +168,9 @@ impl Client { } // Update the server about the player's currently playing animation and the previous one - if let Some(animationHistory) = self.state.read_storage::().get(self.player).cloned() { - if Some(animationHistory.current) != animationHistory.last { - self.postbox.send_message(ClientMsg::PlayerAnimation(animationHistory)); + if let Some(animation_history) = self.state.read_storage::().get(self.player).cloned() { + if Some(animation_history.current) != animation_history.last { + self.postbox.send_message(ClientMsg::PlayerAnimation(animation_history)); } } @@ -230,9 +230,9 @@ impl Client { }, None => {}, }, - ServerMsg::EntityAnimation { entity, animationHistory } => match self.state.ecs().entity_from_uid(entity) { + ServerMsg::EntityAnimation { entity, animation_history } => match self.state.ecs().entity_from_uid(entity) { Some(entity) => { - self.state.write_component(entity, animationHistory); + self.state.write_component(entity, animation_history); }, None => {}, }, diff --git a/common/src/msg/server.rs b/common/src/msg/server.rs index 4b5a1b5517..3372b524fb 100644 --- a/common/src/msg/server.rs +++ b/common/src/msg/server.rs @@ -25,7 +25,7 @@ pub enum ServerMsg { }, EntityAnimation { entity: u64, - animationHistory: comp::AnimationHistory, + animation_history: comp::AnimationHistory, }, TerrainChunkUpdate { key: Vec3, diff --git a/server/src/lib.rs b/server/src/lib.rs index 305667195b..fa9a390eb7 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -246,7 +246,7 @@ impl Server { ClientMsg::Ping => client.postbox.send_message(ServerMsg::Pong), ClientMsg::Pong => {} ClientMsg::Chat(msg) => new_chat_msgs.push((entity, msg)), - ClientMsg::PlayerAnimation(animationHistory) => state.write_component(entity, animationHistory), + ClientMsg::PlayerAnimation(animation_history) => state.write_component(entity, animation_history), ClientMsg::PlayerPhysics { pos, vel, dir } => { state.write_component(entity, pos); state.write_component(entity, vel); @@ -365,7 +365,7 @@ impl Server { }); // Sync logical information other players have authority over, not the server - for (other_entity, &uid, &animationHistory) in ( + for (other_entity, &uid, &animation_history) in ( &state.ecs().internal().entities(), &state.ecs().internal().read_storage::(), &state.ecs().internal().read_storage::(), @@ -373,7 +373,7 @@ impl Server { // AnimationHistory client.postbox.send_message(ServerMsg::EntityAnimation { entity: uid.into(), - animationHistory: animationHistory, + animation_history: animation_history, }); } } @@ -406,28 +406,28 @@ impl Server { } // Sync animation states - for (entity, &uid, &animationHistory) in ( + for (entity, &uid, &animation_history) in ( &self.state.ecs().internal().entities(), &self.state.ecs().internal().read_storage::(), &self.state.ecs().internal().read_storage::(), ).join() { // Check if we need to sync - if Some(animationHistory.current) == animationHistory.last { + if Some(animation_history.current) == animation_history.last { continue; } self.clients.notify_connected_except(entity, ServerMsg::EntityAnimation { entity: uid.into(), - animationHistory, + animation_history, }); } // Update animation last/current state - for (entity, mut animationHistory) in ( + for (entity, mut animation_history) in ( &self.state.ecs().internal().entities(), &mut self.state.ecs().internal().write_storage::() ).join() { - animationHistory.last = Some(animationHistory.current); + animation_history.last = Some(animation_history.current); } // Remove all force flags diff --git a/voxygen/src/scene/figure.rs b/voxygen/src/scene/figure.rs index 02089eb724..66f1a65b27 100644 --- a/voxygen/src/scene/figure.rs +++ b/voxygen/src/scene/figure.rs @@ -83,7 +83,7 @@ impl Figures { pub fn maintain(&mut self, renderer: &mut Renderer, client: &mut Client) { let time = client.state().get_time(); let ecs = client.state_mut().ecs_mut().internal_mut(); - for (entity, pos, dir, character, animationHistory) in ( + for (entity, pos, dir, character, animation_history) in ( &ecs.entities(), &ecs.read_storage::(), &ecs.read_storage::(), @@ -94,7 +94,7 @@ impl Figures { .entry(entity) .or_insert_with(|| FigureState::new(renderer, CharacterSkeleton::new())); - let target_skeleton = match animationHistory.current { + let target_skeleton = match animation_history.current { comp::character::Animation::Idle => IdleAnimation::update_skeleton(&mut state.skeleton, time), comp::character::Animation::Run => RunAnimation::update_skeleton(&mut state.skeleton, time), };