@@ -77,6 +77,9 @@ public Theater(string name)
7777 public List < TileSet > TileSets = new List < TileSet > ( ) ;
7878 public List < LATGround > LATGrounds = new List < LATGround > ( ) ;
7979 public TileSet RampTileSet { get ; set ; }
80+ public TileSet BridgeTileSet { get ; set ; }
81+ public TileSet TrainBridgeTileSet { get ; set ; }
82+ public TileSet WoodBridgeTileSet { get ; set ; }
8083
8184 private const string REQUIRED_SECTION = "General" ;
8285
@@ -129,13 +132,25 @@ public void ReadConfigINI(string baseDirectoryPath, CCFileManager ccFileManager)
129132 InitLATGround ( theaterIni , "CrystalTile" , "ClearToCrystalLat" , null , null , null , "Crystal" ) ;
130133 InitLATGround ( theaterIni , "BlueMoldTile" , "ClearToBlueMoldLat" , null , null , null , "Blue Mold" ) ;
131134
132- int rampTileSetIndex = theaterIni . GetIntValue ( "General" , "RampBase" , - 1 ) ;
133- if ( rampTileSetIndex < 0 || rampTileSetIndex >= TileSets . Count )
135+ RampTileSet = GetTileSetFromKey ( theaterIni , "RampBase" , false ) ;
136+ BridgeTileSet = GetTileSetFromKey ( theaterIni , "BridgeSet" , false ) ;
137+ TrainBridgeTileSet = GetTileSetFromKey ( theaterIni , "TrainBridgeSet" , false ) ;
138+ WoodBridgeTileSet = GetTileSetFromKey ( theaterIni , "WoodBridgeSet" , true ) ; // Wood bridges are optional as they do not exist in TS
139+ }
140+
141+ private TileSet GetTileSetFromKey ( IniFile theaterIni , string key , bool optional )
142+ {
143+ int index = theaterIni . GetIntValue ( "General" , key , - 1 ) ;
144+
145+ if ( index < 0 || index >= TileSets . Count )
134146 {
135- throw new INIConfigException ( "Invalid value specified for RampBase= in the theater configuration file!" ) ;
147+ if ( optional )
148+ return null ;
149+
150+ throw new INIConfigException ( $ "Invalid value specified for { key } = in the theater configuration file!") ;
136151 }
137152
138- RampTileSet = TileSets [ rampTileSetIndex ] ;
153+ return TileSets [ index ] ;
139154 }
140155
141156 public TileSet TryGetTileSetById ( int id )
0 commit comments