コード例 #1
0
        public static SyncStateCommand ClearOfftracks()
        {
            var command = new SyncStateCommand();

            command.StateUpdateType = SyncStateCommand.StateUpdateTypes.ClearOfftracks;
            return(command);
        }
コード例 #2
0
        public static SyncStateCommand UpdateOfftracks(List <Offtrack> offtracks)
        {
            var command = new SyncStateCommand();

            command.StateUpdateType = SyncStateCommand.StateUpdateTypes.Offtracks;
            command.Data            = new { Offtracks = offtracks };
            return(command);
        }
コード例 #3
0
        public static SyncStateCommand UpdateLiveStatus(bool live)
        {
            var command = new SyncStateCommand();

            command.StateUpdateType = SyncStateCommand.StateUpdateTypes.LiveStatusChanged;
            command.Data            = new { IsLive = live };
            return(command);
        }
コード例 #4
0
        public static SyncStateCommand UpdateWatchedDriver(int carId)
        {
            var command = new SyncStateCommand();

            command.StateUpdateType = SyncStateCommand.StateUpdateTypes.WatchedDriverChanged;
            command.Data            = new { CarId = carId };
            return(command);
        }
コード例 #5
0
        public static SyncStateCommand DeletePenalty(Penalty penalty)
        {
            var command = new SyncStateCommand();

            command.StateUpdateType = SyncStateCommand.StateUpdateTypes.DeletePenalty;
            command.Data            = new
            {
                PenaltyId = penalty.Id
            };
            return(command);
        }
コード例 #6
0
        public static SyncStateCommand EditPenalty(Penalty penalty)
        {
            var command = new SyncStateCommand();

            command.StateUpdateType = SyncStateCommand.StateUpdateTypes.EditPenalty;
            command.Data            = new
            {
                Penalty = penalty
            };
            return(command);
        }
コード例 #7
0
        public static SyncStateCommand DeleteEvent(ReplayEvent @event)
        {
            var command = new SyncStateCommand();

            command.StateUpdateType = SyncStateCommand.StateUpdateTypes.DeleteEvent;
            command.Data            = new
            {
                Event = @event
            };
            return(command);
        }
コード例 #8
0
 public void SendStateUpdate(SyncStateCommand command)
 {
     Debug.WriteLine(">> Sending state update: " + command);
     this.SendCommand(command);
     this.OnStateUpdated();
 }