public NewGameController(IEnumerable <TracableStream> staticDataSources) { foreach (var aiFactory in PlayerAssets.AIDefinitions.Values) { aiPlayers.Add(new PlayerType(PlayerControlType.LocalAI, aiFactory)); } //TODO(v0.8) move to controller user players.Add(new NewGamePlayerInfo("Marko Kovač", colors.Take(), null, localHuman)); players.Add(new NewGamePlayerInfo(generateAiName(), colors.Take(), null, aiPlayers.Pick())); this.Statics = StaticsDB.Load(staticDataSources); this.evaluator = new SystemEvaluator(this.Statics); foreach (var populator in MapAssets.StarPopulators) { populator.SetGameData( this.Statics.StarTraits, this.Statics.PlanetTraits, this.Statics.PlanetForumlas.ToDictionary(x => x.Key, x => x.Value.ImplicitTraits) ); } this.CustomStart = LastStartingCondition ?? DefaultStartingCondition; this.StarPositioner = ParameterLoadingVisitor.Load(Settings.Get.LastGame.StarPositionerConfig, MapAssets.StarPositioners); this.StarConnector = ParameterLoadingVisitor.Load(Settings.Get.LastGame.StarConnectorConfig, MapAssets.StarConnectors); this.StarPopulator = ParameterLoadingVisitor.Load(Settings.Get.LastGame.StarPopulatorConfig, MapAssets.StarPopulators); }
public NewGameController(IEnumerable <NamedStream> staticDataSources) { foreach (var aiFactory in PlayerAssets.AIDefinitions.Values) { aiPlayers.Add(new PlayerType(PlayerControlType.LocalAI, aiFactory)); } //TODO(v0.9) move to controller user this.players.AddRange( Settings.Get.LastGame.PlayersConfig != null && Settings.Get.LastGame.PlayersConfig.Length > 1 ? loadPlayerSetup(Settings.Get.LastGame.PlayersConfig) : this.defaultPlayerSetup() ); this.Statics = StaticsDB.Load(staticDataSources); this.evaluator = new SystemEvaluator(this.Statics); foreach (var populator in MapAssets.StarPopulators) { populator.SetGameData( this.Statics.StarTraits, this.Statics.PlanetTraits, this.Statics.PlanetForumlas.ToDictionary(x => x.Key, x => x.Value.ImplicitTraits) ); } this.CustomStart = LastStartingCondition ?? DefaultStartingCondition; this.StarPositioner = ParameterLoadingVisitor.Load(Settings.Get.LastGame.StarPositionerConfig, MapAssets.StarPositioners); this.StarConnector = ParameterLoadingVisitor.Load(Settings.Get.LastGame.StarConnectorConfig, MapAssets.StarConnectors); this.StarPopulator = ParameterLoadingVisitor.Load(Settings.Get.LastGame.StarPopulatorConfig, MapAssets.StarPopulators); }
public NewGameController() { foreach (var aiFactory in PlayerAssets.AIDefinitions) { aiPlayers.Add(new PlayerType(PlayerControlType.LocalAI, aiFactory)); } players.Add(new NewGamePlayerInfo("Marko Kovač", colors.Take(), null, localHuman)); players.Add(new NewGamePlayerInfo(generateAiName(), colors.Take(), null, aiPlayers.Pick())); this.CustomStart = LastStartingCondition ?? DefaultStartingCondition; this.StarPositioner = ParameterLoadingVisitor.Load(Settings.Get.LastGame.StarPositionerConfig, MapAssets.StarPositioners); this.StarConnector = ParameterLoadingVisitor.Load(Settings.Get.LastGame.StarConnectorConfig, MapAssets.StarConnectors); this.StarPopulator = ParameterLoadingVisitor.Load(Settings.Get.LastGame.StarPopulatorConfig, MapAssets.StarPopulators); }