Change fleet generation
authorTheSaminator <thesaminator@users.noreply.github.com>
Mon, 4 Jul 2022 23:15:40 +0000 (19:15 -0400)
committerTheSaminator <thesaminator@users.noreply.github.com>
Mon, 4 Jul 2022 23:15:40 +0000 (19:15 -0400)
src/jvmMain/kotlin/net/starshipfights/campaign/cluster_test.kt

index 252c6b9b9a81c7f5851799ec7b4713a0180a4062..5eb7bcbf7efe794b52c71150265cd2c324ce9d83 100644 (file)
@@ -20,7 +20,10 @@ fun StarClusterView.testPostProcess(): StarClusterView {
        val ownedSystems = (systems.toList().shuffled() zip ownerFlavors).associate { (systemWithId, flavor) ->
                val (systemId, system) = systemWithId
                
-               val numOfFleets = (0..2).random() + (0..2).random() + 1
+               val numOfFleets = (0..1).random() + (0..1).random() + (0..1).random()
+               if (numOfFleets == 0)
+                       return@associate systemId to system
+               
                val fleets = (1..numOfFleets).associate { _ ->
                        val admiralRank = AdmiralRank.values().random()
                        val admiralIsFemale = flavor == FactionFlavor.FELINAE_FELICES || Random.nextBoolean()