aboutsummaryrefslogtreecommitdiff
path: root/web/planetwars-rs
diff options
context:
space:
mode:
Diffstat (limited to 'web/planetwars-rs')
-rw-r--r--web/planetwars-rs/src/lib.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/web/planetwars-rs/src/lib.rs b/web/planetwars-rs/src/lib.rs
index f2ba7e1..85a1d8f 100644
--- a/web/planetwars-rs/src/lib.rs
+++ b/web/planetwars-rs/src/lib.rs
@@ -150,7 +150,6 @@ pub struct Game {
planet_map: HashMap<(String, String), Circle>,
- /* put extra shit here */
view_box: Vec<f32>,
planets: Vec<f32>,
@@ -240,6 +239,10 @@ impl Game {
self.current_planet_colours.clone()
}
+ pub fn get_planet_name(&self, planet_idx: usize) -> String {
+ self.states[self.turn].planets[planet_idx].name.clone()
+ }
+
pub fn turn_count(&self) -> usize {
self.states.len()
}