From f351a002b66ae8a4b73588b7ffdffc69623181f3 Mon Sep 17 00:00:00 2001 From: tom barrett Date: Mon, 22 Jul 2019 02:52:42 -0500 Subject: cleanup --- src/npc.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/npc.rs') diff --git a/src/npc.rs b/src/npc.rs index ad2a750..92d7a1d 100644 --- a/src/npc.rs +++ b/src/npc.rs @@ -24,8 +24,8 @@ impl Operable for NPC { fn update(&mut self) { match self.behavior { - Behavior::Wandering(destination) => self.wandering(destination), - Behavior::Waiting(time) => self.waiting(time), + Behavior::Wandering(destination) => self.move_torwards(destination), + Behavior::Waiting(time) => self.wait(time), } self.entity.update(); self.animations.update(&self.entity.action); @@ -41,7 +41,7 @@ impl NPC { } } - fn wandering(&mut self, destination: Point2) { + fn move_torwards(&mut self, destination: Point2) { let position = self.entity.position; if distance(&position, &destination) < constants::GOAL_DISTANCE { @@ -74,7 +74,7 @@ impl NPC { } } - fn waiting(&mut self, start: Instant) { + fn wait(&mut self, start: Instant) { if start.elapsed().as_secs() > constants::WAIT_TIME { self.behavior = Behavior::Wandering(random_nearby_point( self.entity.spawn, -- cgit v1.2.3