diff options
author | Ilion Beyst <ilion.beyst@gmail.com> | 2022-11-06 21:44:56 +0100 |
---|---|---|
committer | Ilion Beyst <ilion.beyst@gmail.com> | 2022-11-06 21:44:56 +0100 |
commit | 9ed7d7ab2fc70f971aa18d61f5ea04b346c836a3 (patch) | |
tree | eb3c73ca2fdcdcb2a7ede69ae066c289d3f14883 /web/planetwars-rs/src/lib.rs | |
parent | fdc2ab9421c6a38c6bbd9b621c4da4f2c147a773 (diff) | |
download | planetwars.dev-9ed7d7ab2fc70f971aa18d61f5ea04b346c836a3.tar.xz planetwars.dev-9ed7d7ab2fc70f971aa18d61f5ea04b346c836a3.zip |
render planet names
Diffstat (limited to 'web/planetwars-rs/src/lib.rs')
-rw-r--r-- | web/planetwars-rs/src/lib.rs | 5 |
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() } |