// ================================
/// <summary>Call this function to reset the game</summary>
/// <param name="ResetLogs">Whether the logs should be reset</param>
internal static void Reset(bool ResetLogs)
{
// track manager
for (int i = 0; i < TrackManager.Tracks.Length; i++)
{
TrackManager.Tracks[i] = new TrackManager.Track();
}
// train manager
TrainManager.Trains = new TrainManager.Train[] { };
// game
Interface.ClearMessages();
CurrentInterface = InterfaceType.Normal;
RouteComment = "";
RouteImage = "";
RouteAccelerationDueToGravity = 9.80665;
RouteRailGauge = 1.435;
RouteInitialAirPressure = 101325.0;
RouteInitialAirTemperature = 293.15;
RouteInitialElevation = 0.0;
RouteSeaLevelAirPressure = 101325.0;
RouteSeaLevelAirTemperature = 293.15;
Stations = new RouteStation[] { };
CurrentRoute.Sections = new Section[] { };
BufferTrackPositions = new double[] { };
//Messages = new Message[] { };
MarkerTextures = new Texture[] { };
PointsOfInterest = new PointOfInterest[] { };
PrecedingTrainTimeDeltas = new double[] { };
PrecedingTrainSpeedLimit = double.PositiveInfinity;
CurrentRoute.BogusPretrainInstructions = new BogusPretrainInstruction[] { };
TrainName = "";
TrainStart = TrainStartMode.EmergencyBrakesNoAts;
CurrentRoute.NoFogStart = (float)Math.Max(1.33333333333333 * Interface.CurrentOptions.ViewingDistance, 800.0);
CurrentRoute.NoFogEnd = (float)Math.Max(2.66666666666667 * Interface.CurrentOptions.ViewingDistance, 1600.0);
CurrentRoute.PreviousFog = new Fog(CurrentRoute.NoFogStart, CurrentRoute.NoFogEnd, Color24.Grey, 0.0);
CurrentRoute.CurrentFog = new Fog(CurrentRoute.NoFogStart, CurrentRoute.NoFogEnd, Color24.Grey, 0.5);
CurrentRoute.NextFog = new Fog(CurrentRoute.NoFogStart, CurrentRoute.NoFogEnd, Color24.Grey, 1.0);
InfoTotalTriangles = 0;
InfoTotalTriangleStrip = 0;
InfoTotalQuads = 0;
InfoTotalQuadStrip = 0;
InfoTotalPolygon = 0;
InfoStaticOpaqueFaceCount = 0;
if (ResetLogs)
{
LogRouteName = "";
LogTrainName = "";
LogDateTime = DateTime.Now;
CurrentScore = new Score();
ScoreMessages = new ScoreMessage[] { };
ScoreLogs = new ScoreLog[64];
ScoreLogCount = 0;
BlackBoxEntries = new BlackBoxEntry[256];
BlackBoxEntryCount = 0;
BlackBoxNextUpdate = 0.0;
}
// renderer
Renderer.Reset();
}