@@ -4,69 +4,76 @@ import com.fasterxml.jackson.annotation.JsonInclude
44import java.util.*
55import kotlin.collections.ArrayList
66
7-
87const val CONFIG_FILE_NAME = " wurst.build"
98
109/* *
1110 * The root DAO that contains the child DAOs.
1211 * Represents a complete wurst.build file.
1312 */
1413@JsonInclude(JsonInclude .Include .NON_DEFAULT )
15- data class WurstProjectConfigData (var projectName : String ,
16- val dependencies : ArrayList <String > = ArrayList (emptyList()),
17- // val jobs: ArrayList<WurstProjectBuildJob> =
18- // ArrayList(Arrays.asList(WurstProjectBuildJob("run",
19- // ArrayList(Arrays.asList("runcompiletimefunctions", "injectobjects", "stacktraces"))),
20- // WurstProjectBuildJob("build",
21- // ArrayList(Arrays.asList("runcompiletimefunctions", "injectobjects", "stacktraces", "opt", "inline", "localOptimizations"))))),
22- val buildMapData : WurstProjectBuildMapData = WurstProjectBuildMapData ()) {
14+ data class WurstProjectConfigData (
15+ var projectName : String = " unnamed" ,
16+ val dependencies : ArrayList <String > = ArrayList (),
17+ val buildMapData : WurstProjectBuildMapData = WurstProjectBuildMapData ()
18+ ) {
2319 constructor () : this (" unnamed" )
2420}
2521
2622/* * All data needed to generate the output map */
2723@JsonInclude(JsonInclude .Include .NON_DEFAULT )
28- data class WurstProjectBuildMapData (val name : String = " " ,
29- val fileName : String = " " ,
30- val author : String = " " ,
31- val scenarioData : WurstProjectBuildScenarioData = WurstProjectBuildScenarioData (loadingScreen=null),
32- val optionsFlags : WurstProjectBuildOptionFlagsData = WurstProjectBuildOptionFlagsData (),
33- val players : ArrayList <WurstProjectBuildPlayer > = ArrayList (),
34- val forces : ArrayList <WurstProjectBuildForce > = ArrayList ())
24+ data class WurstProjectBuildMapData (
25+ val name : String = " " ,
26+ val fileName : String = " " ,
27+ val author : String = " " ,
28+ val scenarioData : WurstProjectBuildScenarioData = WurstProjectBuildScenarioData (), // CHANGED: No explicit null
29+ val optionsFlags : WurstProjectBuildOptionFlagsData = WurstProjectBuildOptionFlagsData (),
30+ val players : ArrayList <WurstProjectBuildPlayer > = ArrayList (),
31+ val forces : ArrayList <WurstProjectBuildForce > = ArrayList ()
32+ )
3533
3634/* * Wurst job data with list of arguments */
3735@JsonInclude(JsonInclude .Include .NON_DEFAULT )
38- data class WurstProjectBuildJob (val name : String = " DefaultJobName" ,
39- val args : ArrayList <String > = ArrayList (Arrays .asList()))
36+ data class WurstProjectBuildJob (
37+ val name : String = " DefaultJobName" ,
38+ val args : ArrayList <String > = ArrayList () // CHANGED: Removed Arrays.asList()
39+ )
4040
4141/* * Scenario related information */
4242@JsonInclude(JsonInclude .Include .NON_DEFAULT )
43- data class WurstProjectBuildScenarioData (val description : String = " " ,
44- val suggestedPlayers : String = " " ,
45- var loadingScreen : WurstProjectBuildLoadingScreenData ? )
43+ data class WurstProjectBuildScenarioData (
44+ val description : String = " " ,
45+ val suggestedPlayers : String = " " ,
46+ val loadingScreen : WurstProjectBuildLoadingScreenData ? = null // CHANGED: Made it a parameter with default null
47+ )
4648
4749/* * Load screen information. */
4850@JsonInclude(JsonInclude .Include .NON_DEFAULT )
49- data class WurstProjectBuildLoadingScreenData (val model : String = " " ,
50- val background : String = " " ,
51- val title : String = " " ,
52- val subTitle : String = " " ,
53- val text : String = " " )
51+ data class WurstProjectBuildLoadingScreenData (
52+ val model : String = " " ,
53+ val background : String = " " ,
54+ val title : String = " " ,
55+ val subTitle : String = " " ,
56+ val text : String = " "
57+ )
5458
5559/* * Map build flags */
5660@JsonInclude(JsonInclude .Include .NON_DEFAULT )
57- data class WurstProjectBuildOptionFlagsData (val hideMinimapPreview : Boolean = false ,
58- val forcesFixed : Boolean = false ,
59- val maskedAreasPartiallyVisible : Boolean = false ,
60- val showWavesOnCliffShores : Boolean = false ,
61- val showWavesOnRollingShores : Boolean = false ,
62- val useItemClassificationSystem : Boolean = false )
61+ data class WurstProjectBuildOptionFlagsData (
62+ val hideMinimapPreview : Boolean = false ,
63+ val forcesFixed : Boolean = false ,
64+ val maskedAreasPartiallyVisible : Boolean = false ,
65+ val showWavesOnCliffShores : Boolean = false ,
66+ val showWavesOnRollingShores : Boolean = false ,
67+ val useItemClassificationSystem : Boolean = false
68+ )
6369
6470/* * Data for one force (team) in the map */
6571@JsonInclude(JsonInclude .Include .NON_DEFAULT )
66- data class WurstProjectBuildForce (val name : String = " DefaultForce" ,
67- val flags : WurstProjectBuildForceFlags = WurstProjectBuildForceFlags (),
68- val playerIds : IntArray = intArrayOf(0)) {
69-
72+ data class WurstProjectBuildForce (
73+ val name : String = " DefaultForce" ,
74+ val flags : WurstProjectBuildForceFlags = WurstProjectBuildForceFlags (),
75+ val playerIds : IntArray = intArrayOf(0)
76+ ) {
7077 override fun equals (other : Any? ): Boolean {
7178 if (this == = other) return true
7279 if (javaClass != other?.javaClass) return false
@@ -90,11 +97,13 @@ data class WurstProjectBuildForce(val name: String = "DefaultForce",
9097
9198/* * Force flags */
9299@JsonInclude(JsonInclude .Include .NON_DEFAULT )
93- data class WurstProjectBuildForceFlags (val allied : Boolean = true ,
94- val alliedVictory : Boolean = true ,
95- val sharedVision : Boolean = true ,
96- val sharedControl : Boolean = false ,
97- val sharedControlAdvanced : Boolean = false )
100+ data class WurstProjectBuildForceFlags (
101+ val allied : Boolean = true ,
102+ val alliedVictory : Boolean = true ,
103+ val sharedVision : Boolean = true ,
104+ val sharedControl : Boolean = false ,
105+ val sharedControlAdvanced : Boolean = false
106+ )
98107
99108/* * Player race */
100109enum class Race {
@@ -108,9 +117,10 @@ enum class Controller {
108117
109118/* * Data for one player */
110119@JsonInclude(JsonInclude .Include .NON_ABSENT )
111- data class WurstProjectBuildPlayer (val id : Int ,
112- val name : String? ,
113- val race : Race ? ,
114- val controller : Controller ? ,
115- val fixedStartLoc : Boolean? )
116-
120+ data class WurstProjectBuildPlayer (
121+ val id : Int ,
122+ val name : String? = null ,
123+ val race : Race ? = null ,
124+ val controller : Controller ? = null ,
125+ val fixedStartLoc : Boolean? = null
126+ )
0 commit comments