From dd0b9abf0b675570b876a35e529a78dc46968503 Mon Sep 17 00:00:00 2001 From: Dmytro Lysai Date: Thu, 11 Jun 2020 19:59:02 +0300 Subject: [PATCH] Remove World::path_for_object() --- src/game/sequence/move_seq.rs | 2 +- src/game/state.rs | 2 +- src/game/world.rs | 8 -------- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/game/sequence/move_seq.rs b/src/game/sequence/move_seq.rs index 98b2b8f..0db037e 100644 --- a/src/game/sequence/move_seq.rs +++ b/src/game/sequence/move_seq.rs @@ -61,7 +61,7 @@ impl Move { fn rebuild_path(&mut self, world: &mut World) { // TODO non-smooth - self.path = world.path_for_object(self.obj, self.to, true).unwrap_or(Vec::new()); + self.path = world.objects().path(self.obj, self.to, true).unwrap_or(Vec::new()); } fn to_point(&self, world: &World) -> Point { diff --git a/src/game/state.rs b/src/game/state.rs index d9305b4..5637c44 100644 --- a/src/game/state.rs +++ b/src/game/state.rs @@ -1253,7 +1253,7 @@ impl AppState for GameState { let mut wv = ui.widget_mut::(self.world_view); let dude_obj = self.world.borrow().dude_obj().unwrap(); wv.hex_cursor_style = if self.world.borrow() - .path_for_object(dude_obj, PathTo::Point { + .objects().path(dude_obj, PathTo::Point { point: pos.point, neighbor_if_blocked: false, }, false).is_some() diff --git a/src/game/world.rs b/src/game/world.rs index bb827d2..b7166f0 100644 --- a/src/game/world.rs +++ b/src/game/world.rs @@ -343,14 +343,6 @@ impl World { self.objects.make_standing(h, &self.frm_db); } - pub fn path_for_object(&self, - obj: object::Handle, - to: PathTo, - smooth: bool, - ) -> Option> { - self.objects.path(obj, to, smooth) - } - pub fn rebuild_light_grid(&mut self) { self.light_grid.clear(); for h in self.objects.iter() {