Put direction before distance.
This commit is contained in:
parent
64e763a840
commit
9b124e5640
|
@ -293,13 +293,13 @@ pub trait PointLike {
|
||||||
MovementDirection::new(heading.to_degrees())
|
MovementDirection::new(heading.to_degrees())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn distance_and_direction(&self, other: &dyn PointLike) -> String {
|
fn direction_and_distance(&self, other: &dyn PointLike) -> String {
|
||||||
let mut tokens: Vec<String> = vec![];
|
let mut tokens: Vec<String> = vec![];
|
||||||
let distance = self.distance(other).round() as i32;
|
let distance = self.distance(other).round() as i32;
|
||||||
if distance > 0 {
|
if distance > 0 {
|
||||||
let tile_or_tiles = if distance == 1 { "tile" } else { "tiles" };
|
let tile_or_tiles = if distance == 1 { "tile" } else { "tiles" };
|
||||||
let direction: String = self.direction(other).into();
|
let direction: String = self.direction(other).into();
|
||||||
tokens.push(format!("{} {} {}", distance, tile_or_tiles, direction));
|
tokens.push(format!("{} {} {}", direction, distance, tile_or_tiles));
|
||||||
}
|
}
|
||||||
tokens.join(" ")
|
tokens.join(" ")
|
||||||
}
|
}
|
||||||
|
|
|
@ -341,7 +341,7 @@ fn exploration_changed_announcement(
|
||||||
} else {
|
} else {
|
||||||
"Unknown".to_string()
|
"Unknown".to_string()
|
||||||
};
|
};
|
||||||
let mut tokens: Vec<String> = vec![coordinates.distance_and_direction(exploring)];
|
let mut tokens: Vec<String> = vec![coordinates.direction_and_distance(exploring)];
|
||||||
if fog_of_war {
|
if fog_of_war {
|
||||||
tokens.push("in the fog of war".into());
|
tokens.push("in the fog of war".into());
|
||||||
}
|
}
|
||||||
|
|
|
@ -251,7 +251,7 @@ fn log_visible(
|
||||||
if !seen.contains(&*entity) {
|
if !seen.contains(&*entity) {
|
||||||
let name = name.to_string();
|
let name = name.to_string();
|
||||||
let location =
|
let location =
|
||||||
coordinates.distance_and_direction(viewed_coordinates);
|
coordinates.direction_and_distance(viewed_coordinates);
|
||||||
log.push(format!("{}: {}", name, location));
|
log.push(format!("{}: {}", name, location));
|
||||||
}
|
}
|
||||||
new_seen.insert(*entity);
|
new_seen.insert(*entity);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user