Can now choose a map name and load a map from those existing on the phone!

This commit is contained in:
Yair Morgenstern
2019-02-02 23:26:56 +02:00
parent 3a990434f3
commit 81d1a79e19
6 changed files with 106 additions and 39 deletions

View File

@ -20,6 +20,7 @@ class GameParameters{
var humanNations=ArrayList<String>().apply { add("Babylon") }
var numberOfEnemies=3
var mapType= MapType.Perlin
var mapFileName :String?=null
}
class GameStarter{
@ -27,7 +28,7 @@ class GameStarter{
val gameInfo = GameInfo()
gameInfo.gameParameters = newGameParameters
gameInfo.tileMap = TileMap(newGameParameters.mapRadius, newGameParameters.mapType)
gameInfo.tileMap = TileMap(newGameParameters)
gameInfo.tileMap.gameInfo = gameInfo // need to set this transient before placing units in the map
val startingLocations = getStartingLocations(
newGameParameters.numberOfEnemies+newGameParameters.numberOfHumanPlayers, gameInfo.tileMap)