Example #1
0
        private void OnRaceManagerStateChanged(RaceManager.State prev, RaceManager.State current)
        {
            switch (current)
            {
            case RaceManager.State.StartRequested:
            {
                //Tell station to play a tone and start measuring
                var toSend = new Message <StationCommands>
                {
                    Command = StationCommands.StartMeasuring,
                    Data    = null
                };
                SendMessage(_station, toSend);
                break;
            }

            case RaceManager.State.Ready when prev == RaceManager.State.InProgress:
            {
                //Tell station to stop measuring
                var toSend = new Message <StationCommands>
                {
                    Command = StationCommands.StopMeasuring,
                    Data    = null
                };
                SendMessage(_station, toSend);
                break;
            }
            }
        }
        private void OnRaceManagerStateChanged(RaceManager.State prev, RaceManager.State current)
        {
            BroadcastCurrentState();

            if (current == RaceManager.State.InProgress)
            {
                BroadcastRaceStart();
            }

            if (prev == RaceManager.State.InProgress)
            {
                BroadcastRaceEnd();
                BroadcastRaces();
            }
        }
Example #3
0
        private void OnRaceManagerStateChanged(RaceManager.State prev, RaceManager.State current)
        {
            SendCurrentState();

            if (current == RaceManager.State.InProgress)
            {
                SendRaceStart();
            }

            if (prev != RaceManager.State.InProgress)
            {
                return;
            }

            SendRaceEnd();
            SendAvailableRaces();
        }