예제 #1
0
파일: World.cs 프로젝트: Hawk777/iecc8
 /// <summary>
 /// Sets whether an AI driver should disembark once their train is stationary.
 /// </summary>
 /// <param name="train">The ID number of the train.</param>
 /// <param name="hold">Whether to disembark.</param>
 public async Task RelinquishAITrainAsync(int train, bool hold)
 {
     try {
         await Run8.RelinquishAITrainAsync(train, hold);
     } catch (CommunicationException) {
         LinkError = true;
     }
 }
예제 #2
0
파일: World.cs 프로젝트: Hawk777/iecc8
 /// <summary>
 /// Instantly stops an AI train.
 /// </summary>
 /// <param name="train">The ID number of the train.</param>
 public async Task StopAITrainAsync(int train)
 {
     try {
         await Run8.StopAITrainAsync(train);
     } catch (CommunicationException) {
         LinkError = true;
     }
 }
예제 #3
0
파일: World.cs 프로젝트: Hawk777/iecc8
 /// <summary>
 /// Orders an AI crew to board a train.
 /// </summary>
 /// <param name="train">The ID number of the train.</param>
 public async Task AIRecrewAsync(int train)
 {
     try {
         await Run8.AIRecrewTrainAsync(train);
     } catch (CommunicationException) {
         LinkError = true;
     }
 }
예제 #4
0
파일: World.cs 프로젝트: Hawk777/iecc8
 /// <summary>
 /// Drives power points to a position, unlocks them for hand cranking, or relocks them for power operation.
 /// </summary>
 /// <param name="route">Which sub-area the points are in.</param>
 /// <param name="points">Which points to modify.</param>
 /// <param name="state">What action the points should take.</param>
 public async Task ThrowSwitchAsync(int route, int points, ESwitchState state)
 {
     try {
         await Run8.ThrowSwitchAsync(route, points, state);
     } catch (CommunicationException) {
         LinkError = true;
     }
 }
예제 #5
0
파일: World.cs 프로젝트: Hawk777/iecc8
 /// <summary>
 /// Chooses whether a signal is on or off and, if off, whether it has automatic working enabled.
 /// </summary>
 /// <param name="route">The route containing the signal.</param>
 /// <param name="signal">The ID number of the signal.</param>
 /// <param name="indication">Which indication to set.</param>
 public async Task ChangeSignalAsync(int route, int signal, ESignalIndication indication)
 {
     try {
         await Run8.ChangeSignalAsync(route, signal, indication);
     } catch (CommunicationException) {
         LinkError = true;
     }
 }
예제 #6
0
파일: World.cs 프로젝트: Hawk777/iecc8
        /// <summary>
        /// Sends a radio message to the network.
        /// </summary>
        /// <param name="channel">Which channel to transmit on.</param>
        /// <param name="text">The message to send.</param>
        public async void SendRadioMessage(uint channel, string text)
        {
            try {
                await Run8.RadioTextAsync((int)channel, text);

                RadioTextMessage m;
                m.Channel = (int)channel;
                m.Text    = text;
                RadioTX(m);
            } catch (CommunicationException) {
                LinkError = true;
            }
        }