From c200957679e1f0fe663fd3f86cc5637ec0b0d057 Mon Sep 17 00:00:00 2001 From: Max Bradbury Date: Sat, 18 Apr 2020 10:46:33 +0100 Subject: [PATCH] these are public functions, not for internal use --- src/game.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/game.rs b/src/game.rs index b817c92..88774aa 100644 --- a/src/game.rs +++ b/src/game.rs @@ -210,14 +210,14 @@ impl ToString for Game { } impl Game { - fn tile_ids(&self) -> Vec { + pub fn tile_ids(&self) -> Vec { self.tiles.iter().map(|tile| {tile.id}).collect() } /// first available tile ID. /// e.g. if current tile IDs are [0, 2, 3] the result will be `1` /// if current tile IDs are [0, 1, 2] the result will be `3` - fn new_tile_id(&self) -> u64 { + pub fn new_tile_id(&self) -> u64 { let mut new_id = 0; let mut ids = self.tile_ids(); @@ -234,7 +234,7 @@ impl Game { new_id + 1 } /// adds a tile safely and returns the new tile ID - fn add_tile(&mut self, mut tile: Tile) -> u64 { + pub fn add_tile(&mut self, mut tile: Tile) -> u64 { let new_id = self.new_tile_id(); tile.id = new_id; self.tiles.push(tile);