This commit is contained in:
Max Bradbury 2020-07-01 16:23:41 +01:00
parent cf29fd43dc
commit 192e065e06
1 changed files with 3 additions and 0 deletions

View File

@ -774,6 +774,9 @@ impl Game {
new_id new_id
} }
/// todo I think I need a generic `dedupe(&mut self, Vec<T>)` function
/// it would have to take a closure for comparing a given T (see the background_tile below)
/// and a closure for what to do with the changed IDs
pub fn dedupe_tiles(&mut self) { pub fn dedupe_tiles(&mut self) {
let mut tiles_temp = self.tiles.clone(); let mut tiles_temp = self.tiles.clone();
let mut unique_tiles: Vec<Tile> = Vec::new(); let mut unique_tiles: Vec<Tile> = Vec::new();