@@ -373,35 +373,24 @@ public IList<Ruleset> FindRuleSets(string[] searchPaths)
373
373
public abstract bool IsButtonInOuterPanel { get ; }
374
374
375
375
public int InterfaceIndex { get ; set ; }
376
- public IInterfaceAction HandleLoadClassicGame ( GameData gameData )
377
- {
378
- ExpectedMaps = gameData . MapNoSecondaryMaps + 1 ;
379
- Initialization . LoadGraphicsAssets ( this ) ;
380
-
381
- var game = ClassicSaveLoader . LoadSave ( gameData , MainApp . ActiveRuleSet , Initialization . ConfigObject . Rules ) ;
382
-
383
- Initialization . Start ( game ) ;
384
- return DialogHandlers [ LoadOk . Title ] . Show ( this ) ;
385
- }
386
376
387
- public IInterfaceAction HandleLoadScenario ( GameData gameData , string scnName , string scnDirectory )
377
+ public IInterfaceAction HandleLoadScenario ( IGame game , string scnName , string scnDirectory )
388
378
{
389
- ExpectedMaps = gameData . MapNoSecondaryMaps + 1 ;
379
+ ExpectedMaps = game . NoMaps ;
390
380
Initialization . LoadGraphicsAssets ( this ) ;
391
381
392
382
var config = Initialization . ConfigObject ;
393
- config . TechParadigm = gameData . TechParadigm ;
394
- config . ScenarioName = gameData . ScenarioName ;
395
- config . CivNames = gameData . CivTribeName ;
396
- config . CivGenders = gameData . RulerGender ;
397
- config . LeaderNames = gameData . CivLeaderName ;
398
- config . StartingYear = gameData . StartingYear ;
399
- config . TurnYearIncrement = gameData . TurnYearIncrement ;
400
- config . DifficultyLevel = gameData . DifficultyLevel ;
401
- config . MaxTurns = gameData . MaxTurns ;
402
- config . CivsInPlay = gameData . CivsInPlay ;
403
-
404
- var game = ClassicSaveLoader . LoadScn ( gameData , MainApp . ActiveRuleSet , config . Rules ) ;
383
+ config . TechParadigm = game . ScenarioData . TechParadigm ;
384
+ config . ScenarioName = game . ScenarioData . Name ;
385
+ config . CivNames = game . AllCivilizations . Select ( c => c . TribeName ) . ToArray ( ) ;
386
+ config . CivGenders = game . AllCivilizations . Select ( c => c . LeaderGender ) . ToArray ( ) ;
387
+ config . LeaderNames = game . AllCivilizations . Select ( c => c . LeaderName ) . ToArray ( ) ;
388
+ config . StartingYear = game . ScenarioData . StartingYear ;
389
+ config . TurnYearIncrement = game . ScenarioData . TurnYearIncrement ;
390
+ config . DifficultyLevel = game . DifficultyLevel ;
391
+ config . MaxTurns = game . ScenarioData . MaxTurns ;
392
+ config . CivsInPlay = game . AllCivilizations . Select ( c => c . Alive ) . ToArray ( ) ; ;
393
+
405
394
Initialization . Start ( game ) ;
406
395
407
396
var titleImage = "Title.gif" ;
@@ -433,6 +422,15 @@ public IInterfaceAction HandleLoadScenario(GameData gameData, string scnName, st
433
422
return DialogHandlers [ ScenarioLoadedDialog . Title ] . Show ( this ) ;
434
423
}
435
424
425
+ public IInterfaceAction HandleLoadGame ( IGame game , Civ2engine . Rules rules , Ruleset ruleset )
426
+ {
427
+ ExpectedMaps = game . NoMaps ;
428
+ Initialization . LoadGraphicsAssets ( this ) ;
429
+
430
+ Initialization . Start ( game ) ;
431
+ return DialogHandlers [ LoadOk . Title ] . Show ( this ) ;
432
+ }
433
+
436
434
public IInterfaceAction InitNewGame ( bool quickStart )
437
435
{
438
436
Initialization . LoadGraphicsAssets ( this ) ;
@@ -488,15 +486,4 @@ public string GetScientistName(int epoch)
488
486
{
489
487
return Labels . For ( epoch < 3 ? LabelIndex . wisemen : LabelIndex . scientists ) ;
490
488
}
491
-
492
- public IInterfaceAction HandleLoadGame ( IGame game , Civ2engine . Rules rules , Ruleset ruleset )
493
- {
494
-
495
- ExpectedMaps = game . NoMaps ;
496
- Initialization . LoadGraphicsAssets ( this ) ;
497
- Initialization . LoadGraphicsAssets ( this ) ;
498
-
499
- Initialization . Start ( game ) ;
500
- return DialogHandlers [ LoadOk . Title ] . Show ( this ) ;
501
- }
502
489
}
0 commit comments