Inheritance: ITrackParser
示例#1
0
 /// <summary>
 /// 'Force' a track reload.
 /// </summary>
 public void ForceTrackLoad()
 {
     if (Net != null && Telemetry.m.Sim != null)
     {
         Track = new Track.Track(Telemetry.m.Sim, Sim.Session.GameData_TrackFile);
     }
 }
示例#2
0
 /// <summary>
 /// Load new track. Specify location of gamedirectory and file.
 /// </summary>
 /// <param name="sim">Source simulator of track</param>
 /// <param name="track">Relative path from gamedirectory to track file OR track name.</param>
 public void Track_Load(ISimulator sim, string track)
 {
     if (Net == null || !Net.IsClient)
     {
         Track = new Track.Track(sim, track);
     }
 }
示例#3
0
 //TODO: move to track class
 /// <summary>
 /// Loads route from network.
 /// </summary>
 /// <param name="routeCollection"></param>
 public void NetworkTrack_LoadRoute(RouteCollection routeCollection)
 {
     if (Net != null && Net.IsClient)
     {
         Track = new Track.Track(routeCollection);
     }
 }
示例#4
0
        /// <summary>
        /// Whenever a session starts this function will trigger the track parser to load the new track file.
        /// The event Track_Loaded is fired with a 500ms delay to allow the track parser to complete.
        /// The session_start function is trigger from the Simulator_StatePoller, which runs seperately anyway.
        /// </summary>
        /// <param name="sender"></param>
        private void Telemetry_Session_Start(object sender)
        {
            // Start track parser.
            // Wait 500ms because the track-parser may need some time to complete parsing the track.
            if (Net == null || !Net.IsClient)
            {
                Track = new Track.Track(Telemetry.m.Sim, Sim.Session.GameData_TrackFile);
                Thread.Sleep(1000);
            }

            if (Track_Loaded != null)
            {
                Track_Loaded(null);
            }
        }