예제 #1
0
 public void ExportData(ExecutableConnection executableConnection, IdentityCollection identityCollection)
 {
     ResourceHelper.SetResourceText(identityCollection, ResourceId, ResourceText);
     executableConnection.WriteInteger(_valueMapping.Ability, Ability);
     executableConnection.WriteInteger(_valueMapping.Age, Age);
     executableConnection.WriteInteger(_valueMapping.Salary, Salary);
     executableConnection.WriteInteger(_valueMapping.Royalty, Royalty);
 }
예제 #2
0
 public void ExportData(ExecutableConnection executableConnection, IdentityCollection identityCollection)
 {
     ResourceHelper.SetResourceText(identityCollection, _valueMapping.Name.BuildResourceId(), ResourceText);
     executableConnection.WriteInteger(_valueMapping.Value01, Value01);
     executableConnection.WriteInteger(_valueMapping.Value02, Value02);
     executableConnection.WriteInteger(_valueMapping.Value03, Value03);
     executableConnection.WriteInteger(_valueMapping.Value04, Value04);
     executableConnection.WriteInteger(_valueMapping.Value05, Value05);
 }
예제 #3
0
 public void ExportData(ExecutableConnection executableConnection, IdentityCollection identityCollection)
 {
     ResourceHelper.SetResourceText(identityCollection, ResourceId, ResourceText);
     executableConnection.WriteInteger(_valueMapping.Ability, Ability);
     executableConnection.WriteInteger(_valueMapping.Age, Age);
     executableConnection.WriteInteger(_valueMapping.Salary, Salary);
     executableConnection.WriteInteger(_valueMapping.Royalty, Royalty);
     executableConnection.WriteInteger(_valueMapping.Morale, Morale.ConvertToTwentyToHundredStepTwenty());
 }
예제 #4
0
        public void ExportData(ExecutableConnection executableConnection, IdentityCollection identityCollection)
        {
            var valueMapping = new Mapping.PerformanceCurve();

            for (var i = 0; i < Values.Length; i++)
            {
                executableConnection.WriteInteger(valueMapping.Values[i], Values[i]);
            }
        }
예제 #5
0
파일: Engine.cs 프로젝트: Vjww/GpwEditor
 public void ExportData(ExecutableConnection executableConnection, IdentityCollection identityCollection)
 {
     ResourceHelper.SetResourceText(identityCollection, ResourceId, ResourceText);
     executableConnection.WriteInteger(_valueMapping.Fuel, Fuel);
     executableConnection.WriteInteger(_valueMapping.Heat, Heat);
     executableConnection.WriteInteger(_valueMapping.Power, Power);
     executableConnection.WriteInteger(_valueMapping.Reliability, Reliability);
     executableConnection.WriteInteger(_valueMapping.Response, Response);
     executableConnection.WriteInteger(_valueMapping.Rigidity, Rigidity);
     executableConnection.WriteInteger(_valueMapping.Weight, Weight);
 }
예제 #6
0
 public void ExportData(ExecutableConnection executableConnection, IdentityCollection identityCollection)
 {
     ResourceHelper.SetResourceText(identityCollection, ResourceId, ResourceText);
     executableConnection.WriteInteger(_valueMapping.Laps, Laps);
     executableConnection.WriteInteger(_valueMapping.Design, Design);
     executableConnection.WriteInteger(_valueMapping.LapRecordDriver, LapRecordDriver);
     executableConnection.WriteInteger(_valueMapping.LapRecordTeam, LapRecordTeam);
     executableConnection.WriteInteger(_valueMapping.LapRecordTime, LapRecordTime);
     executableConnection.WriteInteger(_valueMapping.LapRecordMph, LapRecordMph);
     executableConnection.WriteInteger(_valueMapping.LapRecordYear, LapRecordYear);
     executableConnection.WriteInteger(_valueMapping.LastRaceDriver, LastRaceDriver);
     executableConnection.WriteInteger(_valueMapping.LastRaceTeam, LastRaceTeam);
     executableConnection.WriteInteger(_valueMapping.LastRaceYear, LastRaceYear);
     executableConnection.WriteInteger(_valueMapping.LastRaceTime, LastRaceTime);
     executableConnection.WriteInteger(_valueMapping.Hospitality, Hospitality);
     executableConnection.WriteInteger(_valueMapping.Speed, Speed);
     executableConnection.WriteInteger(_valueMapping.Grip, Grip);
     executableConnection.WriteInteger(_valueMapping.Surface, Surface);
     executableConnection.WriteInteger(_valueMapping.Tarmac, Tarmac);
     executableConnection.WriteInteger(_valueMapping.Dust, Dust);
     executableConnection.WriteInteger(_valueMapping.Overtaking, Overtaking);
     executableConnection.WriteInteger(_valueMapping.Braking, Braking);
     executableConnection.WriteInteger(_valueMapping.Rain, Rain);
     executableConnection.WriteInteger(_valueMapping.Heat, Heat);
     executableConnection.WriteInteger(_valueMapping.Wind, Wind);
 }
예제 #7
0
        public void ExportData(ExecutableConnection executableConnection, IdentityCollection identityCollection)
        {
            ResourceHelper.SetResourceText(identityCollection, ResourceId, ResourceText);
            executableConnection.WriteInteger(_valueMapping.DryHardGripSupplier, DryHardGrip);
            executableConnection.WriteInteger(_valueMapping.DryHardResilienceSupplier, DryHardResilience);
            executableConnection.WriteInteger(_valueMapping.DryHardStiffnessSupplier, DryHardStiffness);
            executableConnection.WriteInteger(_valueMapping.DryHardTemperatureSupplier, DryHardTemperature);
            executableConnection.WriteInteger(_valueMapping.DrySoftGripSupplier, DrySoftGrip);
            executableConnection.WriteInteger(_valueMapping.DrySoftResilienceSupplier, DrySoftResilience);
            executableConnection.WriteInteger(_valueMapping.DrySoftStiffnessSupplier, DrySoftStiffness);
            executableConnection.WriteInteger(_valueMapping.DrySoftTemperatureSupplier, DrySoftTemperature);
            executableConnection.WriteInteger(_valueMapping.IntermediateGripSupplier, IntermediateGrip);
            executableConnection.WriteInteger(_valueMapping.IntermediateResilienceSupplier, IntermediateResilience);
            executableConnection.WriteInteger(_valueMapping.IntermediateStiffnessSupplier, IntermediateStiffness);
            executableConnection.WriteInteger(_valueMapping.IntermediateTemperatureSupplier, IntermediateTemperature);
            executableConnection.WriteInteger(_valueMapping.WetWeatherGripSupplier, WetWeatherGrip);
            executableConnection.WriteInteger(_valueMapping.WetWeatherResilienceSupplier, WetWeatherResilience);
            executableConnection.WriteInteger(_valueMapping.WetWeatherStiffnessSupplier, WetWeatherStiffness);
            executableConnection.WriteInteger(_valueMapping.WetWeatherTemperatureSupplier, WetWeatherTemperature);

            executableConnection.WriteInteger(_valueMapping.DryHardGripTeam, DryHardGrip);
            executableConnection.WriteInteger(_valueMapping.DryHardResilienceTeam, DryHardResilience);
            executableConnection.WriteInteger(_valueMapping.DryHardStiffnessTeam, DryHardStiffness);
            executableConnection.WriteInteger(_valueMapping.DryHardTemperatureTeam, DryHardTemperature);
            executableConnection.WriteInteger(_valueMapping.DrySoftGripTeam, DrySoftGrip);
            executableConnection.WriteInteger(_valueMapping.DrySoftResilienceTeam, DrySoftResilience);
            executableConnection.WriteInteger(_valueMapping.DrySoftStiffnessTeam, DrySoftStiffness);
            executableConnection.WriteInteger(_valueMapping.DrySoftTemperatureTeam, DrySoftTemperature);
            executableConnection.WriteInteger(_valueMapping.IntermediateGripTeam, IntermediateGrip);
            executableConnection.WriteInteger(_valueMapping.IntermediateResilienceTeam, IntermediateResilience);
            executableConnection.WriteInteger(_valueMapping.IntermediateStiffnessTeam, IntermediateStiffness);
            executableConnection.WriteInteger(_valueMapping.IntermediateTemperatureTeam, IntermediateTemperature);
            executableConnection.WriteInteger(_valueMapping.WetWeatherGripTeam, WetWeatherGrip);
            executableConnection.WriteInteger(_valueMapping.WetWeatherResilienceTeam, WetWeatherResilience);
            executableConnection.WriteInteger(_valueMapping.WetWeatherStiffnessTeam, WetWeatherStiffness);
            executableConnection.WriteInteger(_valueMapping.WetWeatherTemperatureTeam, WetWeatherTemperature);
        }
예제 #8
0
 public void ExportData(ExecutableConnection executableConnection, IdentityCollection identityCollection)
 {
     ResourceHelper.SetResourceText(identityCollection, ResourceId, ResourceText);
     executableConnection.WriteInteger(_valueMapping.Performance, Performance);
     executableConnection.WriteInteger(_valueMapping.Tolerance, Tolerance);
 }
예제 #9
0
 public void ExportData(ExecutableConnection executableConnection, IdentityCollection identityCollection)
 {
     ResourceHelper.SetResourceText(identityCollection, ResourceId, ResourceText);
     executableConnection.WriteInteger(_valueMapping.Salary, Salary);
     executableConnection.WriteInteger(_valueMapping.RaceBonus, RaceBonus);
     executableConnection.WriteInteger(_valueMapping.ChampionshipBonus, ChampionshipBonus);
     executableConnection.WriteInteger(_valueMapping.Age, Age);
     executableConnection.WriteInteger(_valueMapping.Nationality, Nationality);
     executableConnection.WriteInteger(_valueMapping.Unknown, Unknown);
     executableConnection.WriteInteger(_valueMapping.CommentaryIndex, CommentaryIndex);
     executableConnection.WriteInteger(_valueMapping.Speed, Speed);
     executableConnection.WriteInteger(_valueMapping.Skill, Skill);
     executableConnection.WriteInteger(_valueMapping.Overtaking, Overtaking);
     executableConnection.WriteInteger(_valueMapping.WetWeather, WetWeather);
     executableConnection.WriteInteger(_valueMapping.Concentration, Concentration);
     executableConnection.WriteInteger(_valueMapping.Experience, Experience);
     executableConnection.WriteInteger(_valueMapping.Stamina, Stamina);
     executableConnection.WriteInteger(_valueMapping.Morale, Morale);
 }
예제 #10
0
        public void SetGameYear(int gameYear, string gameExecutableFilePath)
        {
            // Calculate adjustment and invert sign
            // e.g. if changing game year from 1998 to 2001, 1998-2001 = -3 = 3
            // e.g. if changing game year from 1998 to 1995, 1998-1995 = 3 = -3
            var adjustment = 1998 - gameYear;

            adjustment = -adjustment;

            // Game year of 2001 will now have an adjustment value of 3
            // Game year of 1995 will now have an adjustment value of -3

            var year1996 = 1996 + adjustment; // Effective game year value for 1996 is 1993/1999
            var year1997 = 1997 + adjustment; // Effective game year value for 1997 is 1994/2000
            var year1998 = 1998 + adjustment; // Effective game year value for 1998 is 1995/2001
            var year1999 = 1999 + adjustment; // Effective game year value for 1999 is 1996/2002
            var year2007 = 2007 + adjustment;

            // Get first leap year from game starting year
            var firstLeapYear = 0;

            for (var i = gameYear; i < gameYear + 10; i++)
            {
                if (DateTime.IsLeapYear(i))
                {
                    firstLeapYear = i;
                    break;
                }
            }
            var secondLeapYear = firstLeapYear + 4;
            var thirdLeapYear  = secondLeapYear + 4;
            var fourthLeapYear = thirdLeapYear + 4;

            var yearAfterFirstLeapYear  = firstLeapYear + 1;
            var yearAfterSecondLeapYear = secondLeapYear + 1;

            var gameStartDayOfWeek = (int)new DateTime(gameYear, 1, 1).DayOfWeek;

            if (gameStartDayOfWeek == 0) // If Sunday
            {
                gameStartDayOfWeek = 7;  // Make Sunday the 7th day to match DayOfWeek logic used in the game
            }

            int gameStartDate;
            var date = 8; // The 8 in Sunday 8th March 1998 (default game start date)

            while (true)
            {
                // If the game start date using new gameYear value is not a Sunday, increment date
                // e.g. for 1999, the next Sunday after 8th March is 14th March
                if (new DateTime(gameYear, 3, date).DayOfWeek != DayOfWeek.Sunday)
                {
                    date++;
                }
                else
                {
                    // Set start date to be a date that is a Sunday
                    gameStartDate = date;
                    break;
                }
            }

            // The day of the week naturally increments each year for 1st January (e.g 1998 = Thursday, 1999 = Friday)
            // But when the year follows a leap year, the day of the week should be incremented by two.
            // e.g. if 2000 is a leap year and started on a Saturday, then 2001 starts on a Monday
            // e.g. if 2004 is a leap year and started on a Thursday, then 2005 starts on a Saturday
            // Note, where there are three leap years in a ten-year period, the day of the week will
            // fall behind by one day as the game code only increments the day of the week twice, as
            // it was assumed that there would only ever be two leap years between 1998-2007.

            // Update all values affected by change in game year
            using (var executableConnection = new ExecutableConnection(gameExecutableFilePath))
            {
                executableConnection.WriteByte(GameStartDateOffset, (byte)gameStartDate);
                executableConnection.WriteInteger(GameStartDayOfWeekOffset, gameStartDayOfWeek);

                executableConnection.WriteInteger(GameYear199601Offset, year1996);
                executableConnection.WriteInteger(GameYear199602Offset, year1996);
                executableConnection.WriteInteger(GameYear199603Offset, year1996);
                executableConnection.WriteInteger(GameYear199604Offset, year1996);
                executableConnection.WriteInteger(GameYear199605Offset, year1996);

                executableConnection.WriteInteger(GameYear199701Offset, year1997);
                executableConnection.WriteInteger(GameYear199702Offset, year1997);
                executableConnection.WriteInteger(GameYear199703Offset, year1997);
                executableConnection.WriteInteger(GameYear199704Offset, year1997);
                executableConnection.WriteInteger(GameYear199705Offset, year1997);
                executableConnection.WriteInteger(GameYear199706Offset, year1997);
                executableConnection.WriteInteger(GameYear199707Offset, year1997);
                executableConnection.WriteInteger(GameYear199708Offset, year1997);
                executableConnection.WriteInteger(GameYear199709Offset, year1997);
                executableConnection.WriteInteger(GameYear199710Offset, year1997);
                executableConnection.WriteInteger(GameYear199711Offset, year1997);
                executableConnection.WriteInteger(GameYear199712Offset, year1997);
                executableConnection.WriteInteger(GameYear199713Offset, year1997);
                executableConnection.WriteInteger(GameYear199714Offset, year1997);
                executableConnection.WriteInteger(GameYear199715Offset, year1997);
                executableConnection.WriteInteger(GameYear199716Offset, year1997);
                executableConnection.WriteInteger(GameYear199717Offset, year1997);
                executableConnection.WriteInteger(GameYear199718Offset, year1997);
                executableConnection.WriteInteger(GameYear199719Offset, year1997);
                executableConnection.WriteInteger(GameYear199720Offset, year1997);
                executableConnection.WriteInteger(GameYear199721Offset, year1997);
                executableConnection.WriteInteger(GameYear199722Offset, year1997);
                executableConnection.WriteInteger(GameYear199723Offset, year1997);
                executableConnection.WriteInteger(GameYear199724Offset, year1997);
                executableConnection.WriteInteger(GameYear199725Offset, year1997);
                executableConnection.WriteInteger(GameYear199726Offset, year1997);
                executableConnection.WriteInteger(GameYear199727Offset, year1997);
                executableConnection.WriteInteger(GameYear199728Offset, year1997);
                executableConnection.WriteInteger(GameYear199729Offset, year1997);

                executableConnection.WriteInteger(GameYear199801Offset, year1998);
                executableConnection.WriteInteger(GameYear199802Offset, year1998);
                executableConnection.WriteInteger(GameYear199803Offset, year1998);
                executableConnection.WriteInteger(GameYear199804Offset, year1998);
                executableConnection.WriteInteger(GameYear199805Offset, year1998);
                executableConnection.WriteInteger(GameYear199806Offset, year1998);
                executableConnection.WriteInteger(GameYear199807Offset, year1998);
                executableConnection.WriteInteger(GameYear199808Offset, year1998);
                executableConnection.WriteInteger(GameYear199809Offset, year1998);
                executableConnection.WriteInteger(GameYear199810Offset, year1998);
                executableConnection.WriteInteger(GameYear199811Offset, year1998);
                executableConnection.WriteInteger(GameYear199812Offset, year1998);
                executableConnection.WriteInteger(GameYear199813Offset, year1998);
                executableConnection.WriteInteger(GameYear199814Offset, year1998);
                executableConnection.WriteInteger(GameYear199815Offset, year1998);
                executableConnection.WriteInteger(GameYear199816Offset, year1998);
                executableConnection.WriteInteger(GameYear199817Offset, year1998);
                executableConnection.WriteInteger(GameYear199818Offset, year1998);
                executableConnection.WriteInteger(GameYear199819Offset, year1998);
                executableConnection.WriteInteger(GameYear199820Offset, year1998);
                executableConnection.WriteInteger(GameYear199821Offset, year1998);

                executableConnection.WriteInteger(GameYear199901Offset, year1999);
                executableConnection.WriteInteger(GameYear199902Offset, year1999);

                executableConnection.WriteInteger(GameYear200001Offset, firstLeapYear);
                executableConnection.WriteInteger(GameYear200002Offset, firstLeapYear);
                executableConnection.WriteInteger(GameYear200003Offset, firstLeapYear);

                executableConnection.WriteInteger(GameYear200101Offset, yearAfterFirstLeapYear);

                executableConnection.WriteInteger(GameYear200401Offset, secondLeapYear);
                executableConnection.WriteInteger(GameYear200402Offset, secondLeapYear);
                executableConnection.WriteInteger(GameYear200403Offset, secondLeapYear);

                executableConnection.WriteInteger(GameYear200501Offset, yearAfterSecondLeapYear);

                executableConnection.WriteInteger(GameYear200701Offset, year2007);
                executableConnection.WriteInteger(GameYear200702Offset, year2007);

                executableConnection.WriteInteger(GameYear200801Offset, thirdLeapYear);

                executableConnection.WriteInteger(GameYear201201Offset, fourthLeapYear);
            }
        }
예제 #11
0
 public void ExportData(ExecutableConnection executableConnection, IdentityCollection identityCollection)
 {
     ResourceHelper.SetResourceText(identityCollection, ResourceId, ResourceText);
     executableConnection.WriteInteger(_valueMapping.CommentaryIndex, CommentaryIndex);
 }
예제 #12
0
파일: Team.cs 프로젝트: Vjww/GpwEditor
 public void ExportData(ExecutableConnection executableConnection, IdentityCollection identityCollection)
 {
     ResourceHelper.SetResourceText(identityCollection, ResourceId, ResourceText);
     executableConnection.WriteInteger(_valueMapping.LastPosition, LastPosition);
     executableConnection.WriteInteger(_valueMapping.LastPoints, LastPoints);
     executableConnection.WriteInteger(_valueMapping.FirstGpTrack, FirstGpTrack);
     executableConnection.WriteInteger(_valueMapping.FirstGpYear, FirstGpYear);
     executableConnection.WriteInteger(_valueMapping.Wins, Wins);
     executableConnection.WriteInteger(_valueMapping.YearlyBudget, YearlyBudget);
     executableConnection.WriteInteger(_valueMapping.Unknown, Unknown);
     executableConnection.WriteInteger(_valueMapping.CountryMapId, CountryMapId);
     executableConnection.WriteInteger(_valueMapping.LocationPointerX, LocationPointerX);
     executableConnection.WriteInteger(_valueMapping.LocationPointerY, LocationPointerY);
     executableConnection.WriteInteger(_valueMapping.TyreSupplierId, TyreSupplierId);
 }
예제 #13
0
        public void ExportData(ExecutableConnection executableConnection, IdentityCollection identityCollection)
        {
            ResourceHelper.SetResourceText(identityCollection, ResourceId, ResourceText);
            executableConnection.WriteInteger(_valueMapping.Salary, Salary);
            executableConnection.WriteInteger(_valueMapping.RaceBonus, RaceBonus);
            executableConnection.WriteInteger(_valueMapping.ChampionshipBonus, ChampionshipBonus);
            executableConnection.WriteInteger(_valueMapping.PayRating, PayRating);
            executableConnection.WriteInteger(_valueMapping.PositiveSalary, PositiveSalary);
            executableConnection.WriteInteger(_valueMapping.LastChampionshipPosition, LastChampionshipPosition);
            executableConnection.WriteInteger(_valueMapping.DriverRole, DriverRole);
            executableConnection.WriteInteger(_valueMapping.CarNumberA, CarNumberA);
            executableConnection.WriteInteger(_valueMapping.Age, Age);
            executableConnection.WriteInteger(_valueMapping.Nationality, Nationality);
            executableConnection.WriteInteger(_valueMapping.CommentaryIndex, CommentaryIndex);
            executableConnection.WriteInteger(_valueMapping.CareerChampionships, CareerChampionships);
            executableConnection.WriteInteger(_valueMapping.CareerRaces, CareerRaces);
            executableConnection.WriteInteger(_valueMapping.CareerWins, CareerWins);
            executableConnection.WriteInteger(_valueMapping.CareerPoints, CareerPoints);
            executableConnection.WriteInteger(_valueMapping.CareerFastestLaps, CareerFastestLaps);
            executableConnection.WriteInteger(_valueMapping.CareerPointsFinishes, CareerPointsFinishes);
            executableConnection.WriteInteger(_valueMapping.CareerPolePositions, CareerPolePositions);
            executableConnection.WriteInteger(_valueMapping.Speed, Speed);
            executableConnection.WriteInteger(_valueMapping.Skill, Skill);
            executableConnection.WriteInteger(_valueMapping.Overtaking, Overtaking);
            executableConnection.WriteInteger(_valueMapping.WetWeather, WetWeather);
            executableConnection.WriteInteger(_valueMapping.Concentration, Concentration);
            executableConnection.WriteInteger(_valueMapping.Experience, Experience);
            executableConnection.WriteInteger(_valueMapping.Stamina, Stamina);
            executableConnection.WriteInteger(_valueMapping.Morale, Morale.ConvertToTwentyToHundredStepTwenty());

            // Only write value if driver is driver 1 or 2, and not T.
            var driverId = LocalResourceId % 8;

            if (driverId == 6 || driverId == 7) // 1 and 2
            {
                executableConnection.WriteInteger(_valueMapping.CarNumberB, CarNumberB);
            }
        }