public void Export(ChassisHandlingDataEntity dataEntity) { if (dataEntity == null) { throw new ArgumentNullException(nameof(dataEntity)); } if (!(dataEntity is ChassisHandlingDataEntity chassisHandlingDataEntity)) { throw new ArgumentNullException(nameof(chassisHandlingDataEntity)); } var dataLocator = _dataLocatorFactory.Create(chassisHandlingDataEntity.Id); dataLocator.Initialise(); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.Value, chassisHandlingDataEntity.Value); }
private void ImportSponsorFias() { var entities = new List <SponsorFiaEntity>(); for (var i = 0; i < SponsorFiaItemCount; i++) { var id = i; var dataEntity = _dataService.SponsorFias.Get(x => x.Id == id).Single(); var entity = _sponsorFiaEntityFactory.Create(id); entity = _mapperService.Map(dataEntity, entity); entities.Add(entity); } _domainService.SetSponsorFias(entities); }
public void Export(PerformanceCurveDataEntity dataEntity) { if (dataEntity == null) { throw new ArgumentNullException(nameof(dataEntity)); } if (!(dataEntity is PerformanceCurveDataEntity performanceCurveDataEntity)) { throw new ArgumentNullException(nameof(performanceCurveDataEntity)); } var dataLocator = _dataLocatorFactory.Create(performanceCurveDataEntity.Id); dataLocator.Initialise(); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.Value, performanceCurveDataEntity.Value); }
private void ImportTyreSupplierLookups() { var entities = new List <TyreSupplierLookupEntity>(); for (var i = 0; i < TyreSupplierLookupItemCount; i++) { var id = i; var dataEntity = _dataService.TyreSupplierLookups.Get(x => x.Id == id).Single(); var entity = _tyreSupplierLookupEntityFactory.Create(id); entity = _mapperService.Map(dataEntity, entity); entities.Add(entity); } _domainService.SetTyreSupplierLookups(entities); }
public void Import() { var entities = new List <PerformanceCurveEntity>(); for (var i = 0; i < PerformanceCurveItemCount; i++) { var id = i; var dataEntity = _dataService.PerformanceCurveValues.Get(x => x.Id == id).Single(); var entity = _performanceCurveEntityFactory.Create(id); entity = _mapperService.Map(dataEntity, entity); entities.Add(entity); } _domainService.SetPerformanceCurves(entities); }
public void Import() { var entities = new List <LanguageEntity>(); for (var i = 0; i < LanguageItemCount; i++) { var id = i; var dataEntity = _dataService.Languages.Get(x => x.Id == id).Single(); var entity = _languageEntityFactory.Create(id); entity = _mapperService.Map(dataEntity, entity); entities.Add(entity); } _domainService.SetLanguages(entities); }
private void ImportCommentaryIndexTeams() { var entities = new List <CommentaryIndexTeamEntity>(); for (var i = 0; i < CommentaryIndexTeamItemCount; i++) { var id = i; var dataEntity = _dataService.CommentaryIndexTeams.Get(x => x.Id == id).Single(); var entity = _commentaryIndexTeamEntityFactory.Create(id); entity = _mapperService.Map(dataEntity, entity); entities.Add(entity); } _domainService.SetCommentaryIndexTeams(entities); }
private void ImportF1Drivers() { var entities = new List <F1DriverEntity>(); for (var i = 0; i < F1DriverItemCount; i++) { var id = i; var dataEntity = _dataService.F1Drivers.Get(x => x.Id == id).Single(); var entity = _f1DriverEntityFactory.Create(id); entity = _mapperService.Map(dataEntity, entity); entities.Add(entity); } _domainService.SetF1Drivers(entities); }
private void ImportNonF1ChiefEngineers() { var entities = new List <NonF1ChiefEngineerEntity>(); for (var i = 0; i < NonF1ChiefItemCount; i++) { var id = i; var dataEntity = _dataService.NonF1ChiefEngineers.Get(x => x.Id == id).Single(); var entity = _nonF1ChiefEngineerEntityFactory.Create(id); entity = _mapperService.Map(dataEntity, entity); entities.Add(entity); } _domainService.SetNonF1ChiefEngineers(entities); }
private void ImportDriverNationalityLookups() { var entities = new List <DriverNationalityLookupEntity>(); for (var i = 0; i < DriverNationalityLookupItemCount; i++) { var id = i; var dataEntity = _dataService.DriverNationalityLookups.Get(x => x.Id == id).Single(); var entity = _driverNationalityLookupEntityFactory.Create(id); entity = _mapperService.Map(dataEntity, entity); entities.Add(entity); } _domainService.SetDriverNationalityLookups(entities); }
public SponsorNameLookupDataEntity Import(int id) { if (id < 0) { throw new ArgumentOutOfRangeException(nameof(id)); } var dataLocator = _dataLocatorFactory.Create(id); dataLocator.Initialise(); var result = _dataEntityFactory.Create(id); result.Value = id; // TODO: Could use identity calculator and do for loop 0-98 result.Description = result.Value == 0 ? "None" : _dataEndpoint.EnglishLanguageCatalogue.Read(dataLocator.Description).Value; return(result); }
public TrackDriverLookupDataEntity Import(int id) { if (id < 0) { throw new ArgumentOutOfRangeException(nameof(id)); } var dataLocator = _dataLocatorFactory.Create(id); dataLocator.Initialise(); var result = _dataEntityFactory.Create(id); result.Value = _identityCalculator.GetTrackDriverNameId(result.Id); result.Description = _dataEndpoint.EnglishLanguageCatalogue.Read(dataLocator.Description).Value; return(result); }
public CommentaryPrefixTeamDataEntity Import(int id) { if (id < 0) { throw new ArgumentOutOfRangeException(nameof(id)); } var dataLocator = _dataLocatorFactory.Create(id); dataLocator.Initialise(); var result = _dataEntityFactory.Create(id); result.CommentaryIndex = dataLocator.CommentaryIndexOut; result.FileNamePrefix = _dataEndpoint.EnglishCommentaryCatalogue.Read(dataLocator.CommentaryIndexOut).FileNamePrefix; return(result); }
public CommentaryIndexDriverDataEntity Import(int id) { if (id < 0) { throw new ArgumentOutOfRangeException(nameof(id)); } var dataLocator = _dataLocatorFactory.Create(id); dataLocator.Initialise(); var result = _dataEntityFactory.Create(id); ImportLanguageCatalogueValue(_dataEndpoint, result.Name, dataLocator.Name); result.CommentaryIndex = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.CommentaryIndex); return(result); }
public void Export(CarNumberDataEntity dataEntity) { if (dataEntity == null) { throw new ArgumentNullException(nameof(dataEntity)); } if (!(dataEntity is CarNumberDataEntity carNumberDataEntity)) { throw new ArgumentNullException(nameof(carNumberDataEntity)); } var dataLocator = _dataLocatorFactory.Create(carNumberDataEntity.Id); dataLocator.Initialise(); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.ValueA, carNumberDataEntity.ValueA); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.ValueB, carNumberDataEntity.ValueB); }
public void Export(F1DriverDataEntity dataEntity) { if (dataEntity == null) { throw new ArgumentNullException(nameof(dataEntity)); } if (!(dataEntity is F1DriverDataEntity f1DriverDataEntity)) { throw new ArgumentNullException(nameof(f1DriverDataEntity)); } var dataLocator = _dataLocatorFactory.Create(f1DriverDataEntity.Id); dataLocator.Initialise(); ExportLanguageCatalogueValue(_dataEndpoint, f1DriverDataEntity.Name, dataLocator.Name); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.Salary, f1DriverDataEntity.Salary); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.RaceBonus, f1DriverDataEntity.RaceBonus); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.ChampionshipBonus, f1DriverDataEntity.ChampionshipBonus); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.PayRating, f1DriverDataEntity.PayRating); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.PositiveSalary, f1DriverDataEntity.PositiveSalary); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.LastChampionshipPosition, f1DriverDataEntity.LastChampionshipPosition); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.Role, f1DriverDataEntity.Role); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.Age, f1DriverDataEntity.Age); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.Nationality, f1DriverDataEntity.Nationality); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.CareerChampionships, f1DriverDataEntity.CareerChampionships); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.CareerRaces, f1DriverDataEntity.CareerRaces); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.CareerWins, f1DriverDataEntity.CareerWins); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.CareerPoints, f1DriverDataEntity.CareerPoints); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.CareerFastestLaps, f1DriverDataEntity.CareerFastestLaps); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.CareerPointsFinishes, f1DriverDataEntity.CareerPointsFinishes); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.CareerPolePositions, f1DriverDataEntity.CareerPolePositions); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.Speed, f1DriverDataEntity.Speed); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.Skill, f1DriverDataEntity.Skill); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.Overtaking, f1DriverDataEntity.Overtaking); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.WetWeather, f1DriverDataEntity.WetWeather); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.Concentration, f1DriverDataEntity.Concentration); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.Experience, f1DriverDataEntity.Experience); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.Stamina, f1DriverDataEntity.Stamina); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.Morale, f1DriverDataEntity.Morale); }
public CarNumberDataEntity Import(int id) { if (id < 0) { throw new ArgumentOutOfRangeException(nameof(id)); } var dataLocator = _dataLocatorFactory.Create(id); dataLocator.Initialise(); var result = _dataEntityFactory.Create(id); result.PositionId = result.Id % 2; result.ValueA = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.ValueA); result.ValueB = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.ValueB); return(result); }
public void Export(CommentaryIndexTeamDataEntity dataEntity) { if (dataEntity == null) { throw new ArgumentNullException(nameof(dataEntity)); } if (!(dataEntity is CommentaryIndexTeamDataEntity commentaryIndexTeamDataEntity)) { throw new ArgumentNullException(nameof(commentaryIndexTeamDataEntity)); } var dataLocator = _dataLocatorFactory.Create(commentaryIndexTeamDataEntity.Id); dataLocator.Initialise(); ExportLanguageCatalogueValue(_dataEndpoint, commentaryIndexTeamDataEntity.Name, dataLocator.Name); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.CommentaryIndex, commentaryIndexTeamDataEntity.CommentaryIndex); }
public F1DriverDataEntity Import(int id) { if (id < 0) { throw new ArgumentOutOfRangeException(nameof(id)); } var dataLocator = _dataLocatorFactory.Create(id); dataLocator.Initialise(); var result = _dataEntityFactory.Create(id); ImportLanguageCatalogueValue(_dataEndpoint, result.Name, dataLocator.Name); result.Salary = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.Salary); result.RaceBonus = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.RaceBonus); result.ChampionshipBonus = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.ChampionshipBonus); result.PayRating = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.PayRating); result.PositiveSalary = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.PositiveSalary); result.LastChampionshipPosition = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.LastChampionshipPosition); result.Role = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.Role); result.Age = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.Age); result.Nationality = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.Nationality); result.CareerChampionships = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.CareerChampionships); result.CareerRaces = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.CareerRaces); result.CareerWins = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.CareerWins); result.CareerPoints = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.CareerPoints); result.CareerFastestLaps = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.CareerFastestLaps); result.CareerPointsFinishes = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.CareerPointsFinishes); result.CareerPolePositions = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.CareerPolePositions); result.Speed = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.Speed); result.Skill = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.Skill); result.Overtaking = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.Overtaking); result.WetWeather = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.WetWeather); result.Concentration = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.Concentration); result.Experience = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.Experience); result.Stamina = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.Stamina); result.Morale = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.Morale); return(result); }
public NonF1ChiefCommercialDataEntity Import(int id) { if (id < 0) { throw new ArgumentOutOfRangeException(nameof(id)); } var dataLocator = _dataLocatorFactory.Create(id); dataLocator.Initialise(); var result = _dataEntityFactory.Create(id); ImportLanguageCatalogueValue(_dataEndpoint, result.Name, dataLocator.Name); result.Ability = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.Ability); result.Age = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.Age); result.Salary = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.Salary); result.Royalty = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.Royalty); return(result); }
public LanguageDataEntity Import(int id) { if (id < 0) { throw new ArgumentOutOfRangeException(nameof(id)); } var dataLocator = _dataLocatorFactory.Create(id); dataLocator.Initialise(); var result = _dataEntityFactory.Create(id); result.Index = _dataEndpoint.EnglishLanguageCatalogue.Read(dataLocator.Id).Key; result.EnglishValue = _dataEndpoint.EnglishLanguageCatalogue.Read(dataLocator.Id).Value; result.FrenchValue = _dataEndpoint.FrenchLanguageCatalogue.Read(dataLocator.Id).Value; result.GermanValue = _dataEndpoint.GermanLanguageCatalogue.Read(dataLocator.Id).Value; result.IsShared = _languageValueConfigurationService.GetSharedStatus(dataLocator.Id); return(result); }
public void Export(TrackDataEntity dataEntity) { if (dataEntity == null) { throw new ArgumentNullException(nameof(dataEntity)); } if (!(dataEntity is TrackDataEntity trackDataEntity)) { throw new ArgumentNullException(nameof(trackDataEntity)); } var dataLocator = _dataLocatorFactory.Create(trackDataEntity.Id); dataLocator.Initialise(); ExportLanguageCatalogueValue(_dataEndpoint, trackDataEntity.Name, dataLocator.Name); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.Laps, trackDataEntity.Laps); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.Layout, trackDataEntity.Layout); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.LapRecordDriver, trackDataEntity.LapRecordDriver); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.LapRecordTeam, trackDataEntity.LapRecordTeam); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.LapRecordTime, trackDataEntity.LapRecordTime); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.LapRecordMph, trackDataEntity.LapRecordMph); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.LapRecordYear, trackDataEntity.LapRecordYear); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.LastRaceDriver, trackDataEntity.LastRaceDriver); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.LastRaceTeam, trackDataEntity.LastRaceTeam); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.LastRaceYear, trackDataEntity.LastRaceYear); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.LastRaceTime, trackDataEntity.LastRaceTime); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.Hospitality, trackDataEntity.Hospitality); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.Speed, trackDataEntity.Speed); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.Grip, trackDataEntity.Grip); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.Surface, trackDataEntity.Surface); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.Tarmac, trackDataEntity.Tarmac); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.Dust, trackDataEntity.Dust); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.Overtaking, trackDataEntity.Overtaking); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.Braking, trackDataEntity.Braking); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.Rain, trackDataEntity.Rain); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.Heat, trackDataEntity.Heat); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.Wind, trackDataEntity.Wind); }
public SponsorContractDataEntity Import(int id) { if (id < 0) { throw new ArgumentOutOfRangeException(nameof(id)); } var dataLocator = _dataLocatorFactory.Create(id); dataLocator.Initialise(); var result = _dataEntityFactory.Create(id); result.TeamId = id / 10 + 1; result.SlotId = (id + 1) - 10 * (result.TeamId - 1); switch (result.SlotId) { case int n when(n >= 1 && n <= 4): result.SlotTypeId = result.SlotId; break; case int n when(n >= 5 && n <= 10): result.SlotTypeId = 5; break; default: throw new ArgumentOutOfRangeException(); } result.SponsorId = ImportSponsorId(dataLocator, result.TeamId, result.SlotId); result.Cash = ImportCashValue(dataLocator); // Note: result.DealId is imported via another module and will be populated retrospectively // Note: result.TermsId is imported via another module and will be populated retrospectively return(result); }
public void Import() { var teams = new List <TeamEntity>(); for (var i = 0; i < ItemCount; i++) { var id = i; var teamDataEntity = _dataService.Teams.Get(x => x.Id == id).Single(); var chassisHandlingDataEntity = _dataService.ChassisHandlings.Get(x => x.Id == id).Single(); var carNumberDataEntities = _dataService.CarNumbers.Get(x => x.Id / 2 == id); // Map three into one var team = _teamEntityFactory.Create(id); team = _mapperService.Map(teamDataEntity, team); team = _mapperService.Map(chassisHandlingDataEntity, team); team = _mapperService.Map(_carNumbersMapper.Map(carNumberDataEntities), team); teams.Add(team); } _domainService.SetTeams(teams); }
public void Export(NonF1ChiefCommercialDataEntity dataEntity) { if (dataEntity == null) { throw new ArgumentNullException(nameof(dataEntity)); } if (!(dataEntity is NonF1ChiefCommercialDataEntity nonF1ChiefCommercialDataEntity)) { throw new ArgumentNullException(nameof(nonF1ChiefCommercialDataEntity)); } var dataLocator = _dataLocatorFactory.Create(nonF1ChiefCommercialDataEntity.Id); dataLocator.Initialise(); ExportLanguageCatalogueValue(_dataEndpoint, nonF1ChiefCommercialDataEntity.Name, dataLocator.Name); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.Ability, nonF1ChiefCommercialDataEntity.Ability); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.Age, nonF1ChiefCommercialDataEntity.Age); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.Salary, nonF1ChiefCommercialDataEntity.Salary); _dataEndpoint.GameExecutableFileResource.WriteInteger(dataLocator.Royalty, nonF1ChiefCommercialDataEntity.Royalty); }
public TrackDataEntity Import(int id) { if (id < 0) { throw new ArgumentOutOfRangeException(nameof(id)); } var dataLocator = _dataLocatorFactory.Create(id); dataLocator.Initialise(); var result = _dataEntityFactory.Create(id); ImportLanguageCatalogueValue(_dataEndpoint, result.Name, dataLocator.Name); result.Laps = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.Laps); result.Layout = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.Layout); result.LapRecordDriver = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.LapRecordDriver); result.LapRecordTeam = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.LapRecordTeam); result.LapRecordTime = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.LapRecordTime); result.LapRecordMph = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.LapRecordMph); result.LapRecordYear = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.LapRecordYear); result.LastRaceDriver = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.LastRaceDriver); result.LastRaceTeam = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.LastRaceTeam); result.LastRaceYear = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.LastRaceYear); result.LastRaceTime = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.LastRaceTime); result.Hospitality = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.Hospitality); result.Speed = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.Speed); result.Grip = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.Grip); result.Surface = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.Surface); result.Tarmac = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.Tarmac); result.Dust = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.Dust); result.Overtaking = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.Overtaking); result.Braking = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.Braking); result.Rain = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.Rain); result.Heat = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.Heat); result.Wind = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.Wind); return(result); }
private void ImportCommentaryDrivers() { var entities = new List <CommentaryDriverEntity>(); for (var i = 0; i < CommentaryDriverItemCount; i++) { // Special case where this import only takes into the domain-side the first of five sets of records that are available on the data-side. // Note that only the first <CommentaryDriverItemCount> records are processed from a larger set of records that are available. // This ensures that the driver names and file name prefixes that come from the data-side are only taken from the // driver commentary transcripts for P1, and where P2, P3, Out and Pit are ignored. // Refer to export for opposite logic. var id = i; var dataEntity = _dataService.CommentaryDrivers.Get(x => x.Id == id).Single(); var entity = _commentaryDriverEntityFactory.Create(id); entity = _mapperService.Map(dataEntity, entity); entities.Add(entity); } _domainService.SetCommentaryDrivers(entities); }
public void Export() { var teams = _domainService.GetTeams(); foreach (var team in teams) { // Map one into three var teamDataEntity = _teamDataEntityFactory.Create(team.Id); _mapperService.Map(team, teamDataEntity); var chassisHandlingDataEntity = _chassisHandlingDataEntityFactory.Create(team.Id); _mapperService.Map(team, chassisHandlingDataEntity); var carNumbersObject = _carNumbersObjectFactory.Create(team.Id); var carNumberDataEntities = _carNumbersMapper.Map(_mapperService.Map(team, carNumbersObject)); _dataService.Teams.SetById(teamDataEntity); _dataService.ChassisHandlings.SetById(chassisHandlingDataEntity); foreach (var item in carNumberDataEntities) { _dataService.CarNumbers.SetById(item); } } }
public F1ChiefDesignerDataEntity Import(int id) { if (id < 0) { throw new ArgumentOutOfRangeException(nameof(id)); } var dataLocator = _dataLocatorFactory.Create(id); dataLocator.Initialise(); var result = _dataEntityFactory.Create(id); ImportLanguageCatalogueValue(_dataEndpoint, result.Name, dataLocator.Name); result.Ability = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.Ability); result.Age = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.Age); result.Salary = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.Salary); result.RaceBonus = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.RaceBonus); result.ChampionshipBonus = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.ChampionshipBonus); result.DriverLoyalty = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.DriverLoyalty); result.Morale = _dataEndpoint.GameExecutableFileResource.ReadInteger(dataLocator.Morale); return(result); }
public void Export(CommentaryPrefixDriverDataEntity dataEntity) { if (dataEntity == null) { throw new ArgumentNullException(nameof(dataEntity)); } if (!(dataEntity is CommentaryPrefixDriverDataEntity commentaryPrefixDriverDataEntity)) { throw new ArgumentNullException(nameof(commentaryPrefixDriverDataEntity)); } var dataLocator = _dataLocatorFactory.Create(commentaryPrefixDriverDataEntity.Id); dataLocator.Initialise(); var englishCatalogueItemP1 = _dataEndpoint.EnglishCommentaryCatalogue.Read(dataLocator.CommentaryIndexP1); var frenchCatalogueItemP1 = _dataEndpoint.FrenchCommentaryCatalogue.Read(dataLocator.CommentaryIndexP1); var germanCatalogueItemP1 = _dataEndpoint.GermanCommentaryCatalogue.Read(dataLocator.CommentaryIndexP1); englishCatalogueItemP1.FileNamePrefix = commentaryPrefixDriverDataEntity.FileNamePrefix; frenchCatalogueItemP1.FileNamePrefix = commentaryPrefixDriverDataEntity.FileNamePrefix; germanCatalogueItemP1.FileNamePrefix = commentaryPrefixDriverDataEntity.FileNamePrefix; _dataEndpoint.EnglishCommentaryCatalogue.Write(dataLocator.CommentaryIndexP1, englishCatalogueItemP1); _dataEndpoint.FrenchCommentaryCatalogue.Write(dataLocator.CommentaryIndexP1, frenchCatalogueItemP1); _dataEndpoint.GermanCommentaryCatalogue.Write(dataLocator.CommentaryIndexP1, germanCatalogueItemP1); var englishCatalogueItemP2 = _dataEndpoint.EnglishCommentaryCatalogue.Read(dataLocator.CommentaryIndexP2); var frenchCatalogueItemP2 = _dataEndpoint.FrenchCommentaryCatalogue.Read(dataLocator.CommentaryIndexP2); var germanCatalogueItemP2 = _dataEndpoint.GermanCommentaryCatalogue.Read(dataLocator.CommentaryIndexP2); englishCatalogueItemP2.FileNamePrefix = commentaryPrefixDriverDataEntity.FileNamePrefix; frenchCatalogueItemP2.FileNamePrefix = commentaryPrefixDriverDataEntity.FileNamePrefix; germanCatalogueItemP2.FileNamePrefix = commentaryPrefixDriverDataEntity.FileNamePrefix; _dataEndpoint.EnglishCommentaryCatalogue.Write(dataLocator.CommentaryIndexP2, englishCatalogueItemP2); _dataEndpoint.FrenchCommentaryCatalogue.Write(dataLocator.CommentaryIndexP2, frenchCatalogueItemP2); _dataEndpoint.GermanCommentaryCatalogue.Write(dataLocator.CommentaryIndexP2, germanCatalogueItemP2); var englishCatalogueItemP3 = _dataEndpoint.EnglishCommentaryCatalogue.Read(dataLocator.CommentaryIndexP3); var frenchCatalogueItemP3 = _dataEndpoint.FrenchCommentaryCatalogue.Read(dataLocator.CommentaryIndexP3); var germanCatalogueItemP3 = _dataEndpoint.GermanCommentaryCatalogue.Read(dataLocator.CommentaryIndexP3); englishCatalogueItemP3.FileNamePrefix = commentaryPrefixDriverDataEntity.FileNamePrefix; frenchCatalogueItemP3.FileNamePrefix = commentaryPrefixDriverDataEntity.FileNamePrefix; germanCatalogueItemP3.FileNamePrefix = commentaryPrefixDriverDataEntity.FileNamePrefix; _dataEndpoint.EnglishCommentaryCatalogue.Write(dataLocator.CommentaryIndexP3, englishCatalogueItemP3); _dataEndpoint.FrenchCommentaryCatalogue.Write(dataLocator.CommentaryIndexP3, frenchCatalogueItemP3); _dataEndpoint.GermanCommentaryCatalogue.Write(dataLocator.CommentaryIndexP3, germanCatalogueItemP3); var englishCatalogueItemOut = _dataEndpoint.EnglishCommentaryCatalogue.Read(dataLocator.CommentaryIndexOut); var frenchCatalogueItemOut = _dataEndpoint.FrenchCommentaryCatalogue.Read(dataLocator.CommentaryIndexOut); var germanCatalogueItemOut = _dataEndpoint.GermanCommentaryCatalogue.Read(dataLocator.CommentaryIndexOut); englishCatalogueItemOut.FileNamePrefix = commentaryPrefixDriverDataEntity.FileNamePrefix; frenchCatalogueItemOut.FileNamePrefix = commentaryPrefixDriverDataEntity.FileNamePrefix; germanCatalogueItemOut.FileNamePrefix = commentaryPrefixDriverDataEntity.FileNamePrefix; _dataEndpoint.EnglishCommentaryCatalogue.Write(dataLocator.CommentaryIndexOut, englishCatalogueItemOut); _dataEndpoint.FrenchCommentaryCatalogue.Write(dataLocator.CommentaryIndexOut, frenchCatalogueItemOut); _dataEndpoint.GermanCommentaryCatalogue.Write(dataLocator.CommentaryIndexOut, germanCatalogueItemOut); var englishCatalogueItemPits = _dataEndpoint.EnglishCommentaryCatalogue.Read(dataLocator.CommentaryIndexPits); var frenchCatalogueItemPits = _dataEndpoint.FrenchCommentaryCatalogue.Read(dataLocator.CommentaryIndexPits); var germanCatalogueItemPits = _dataEndpoint.GermanCommentaryCatalogue.Read(dataLocator.CommentaryIndexPits); englishCatalogueItemPits.FileNamePrefix = commentaryPrefixDriverDataEntity.FileNamePrefix; frenchCatalogueItemPits.FileNamePrefix = commentaryPrefixDriverDataEntity.FileNamePrefix; germanCatalogueItemPits.FileNamePrefix = commentaryPrefixDriverDataEntity.FileNamePrefix; _dataEndpoint.EnglishCommentaryCatalogue.Write(dataLocator.CommentaryIndexPits, englishCatalogueItemPits); _dataEndpoint.FrenchCommentaryCatalogue.Write(dataLocator.CommentaryIndexPits, frenchCatalogueItemPits); _dataEndpoint.GermanCommentaryCatalogue.Write(dataLocator.CommentaryIndexPits, germanCatalogueItemPits); }