package technology.zim import technology.zim.data.Tile import technology.zim.data.TileProperties import technology.zim.data.WorldData import java.util.* //Singleton object containing a set of tiles //Has helper functions included //For now, keep it small with uncompresed tile representation //In the future, this could be stored in a gzipped file and memory mapped //Location in array is the tile's coordinates //Each element contains a TileProperties // Which currently only contains the edges of the "graph", stored as directions object World { //Default size should be 20 val tiles = WorldData(ArrayList>()) var sizeX = 10 var sizeY = 10 fun update(tile: Tile, to: TileProperties) { tiles.value[tile.x()][tile.y()] = to } fun get(tile: Tile): TileProperties { return tiles.value[tile.x()][tile.y()] } //Returns a coordinate pair fun getRandomLocation(): Tile { return Tile((0..