Наследование: ViewModelBase
Пример #1
0
 public void RemoveSeat(SeatViewModel seat)
 {
     LeftSeats.Remove(seat);
     RightSeats.Remove(seat);
     Seats.Remove(seat);
     Trace.Assert(LeftSeats.Count + RightSeats.Count == Seats.Count);
 }
Пример #2
0
        public bool KickPlayer(SeatViewModel seat)
        {
            var index = CurrentRoom.Seats.IndexOf(seat);

            if (index < 0)
            {
                return(false);
            }
            return(_IsSuccess(Connection.Kick(index)));
        }
Пример #3
0
        public bool CloseSeat(SeatViewModel seat)
        {
            var index = CurrentRoom.Seats.IndexOf(seat);

            if (index < 0)
            {
                return(false);
            }
            return(_IsSuccess(Connection.CloseSeat(index)));
        }
Пример #4
0
        public bool JoinSeat(SeatViewModel seat)
        {
            if (CurrentSeat == null)
            {
                if (!EnterRoom())
                {
                    return(false);
                }
            }
            var index = CurrentRoom.Seats.IndexOf(seat);

            if (index < 0)
            {
                return(false);
            }
            return(_IsSuccess(Connection.ChangeSeat(index)));
        }
Пример #5
0
 public void AddSeat(SeatViewModel seat, bool?addToLeft = null)
 {
     if (addToLeft == true)
     {
         _leftSeats.Add(seat);
     }
     else if (addToLeft == false)
     {
         _rightSeats.Add(seat);
     }
     else
     {
         var side = _leftSeats.Count > _rightSeats.Count ? _rightSeats : _leftSeats;
         side.Add(seat);
     }
     _seats.Add(seat);
     Trace.Assert(LeftSeats.Count + RightSeats.Count == Seats.Count);
 }
Пример #6
0
 public void RemoveSeat(SeatViewModel seat)
 {
     LeftSeats.Remove(seat);
     RightSeats.Remove(seat);
     Seats.Remove(seat);
     Trace.Assert(LeftSeats.Count + RightSeats.Count == Seats.Count);
 }
Пример #7
0
 public void AddSeat(SeatViewModel seat, bool? addToLeft = null)
 {
     if (addToLeft == true)
     {
         _leftSeats.Add(seat);
     }
     else if (addToLeft == false)
     {
         _rightSeats.Add(seat);
     }
     else
     {
         var side = _leftSeats.Count > _rightSeats.Count ? _rightSeats : _leftSeats;
         side.Add(seat);
     }
     _seats.Add(seat);
     Trace.Assert(LeftSeats.Count + RightSeats.Count == Seats.Count);
 }
Пример #8
0
 public bool OpenSeat(SeatViewModel seat)
 {
     return _IsSuccess(Connection.OpenSeat(LoginToken, CurrentRoom.Seats.IndexOf(seat)));
 }
Пример #9
0
 public bool KickPlayer(SeatViewModel seat)
 {
     return _IsSuccess(Connection.Kick(LoginToken, CurrentRoom.Seats.IndexOf(seat)));
 }
Пример #10
0
 public bool JoinSeat(SeatViewModel seat)
 {
     if (CurrentSeat == null)
     {
         if (!EnterRoom()) return false;
     }
     return _IsSuccess(Connection.ChangeSeat(LoginToken, CurrentRoom.Seats.IndexOf(seat)));
 }
Пример #11
0
 public bool OpenSeat(SeatViewModel seat)
 {
     var index = CurrentRoom.Seats.IndexOf(seat);
     if (index < 0) return false;
     return _IsSuccess(Connection.OpenSeat(index));
 }
Пример #12
0
 public bool KickPlayer(SeatViewModel seat)
 {
     var index = CurrentRoom.Seats.IndexOf(seat);
     if (index < 0) return false;
     return _IsSuccess(Connection.Kick(index));
 }
Пример #13
0
 public bool JoinSeat(SeatViewModel seat)
 {
     if (CurrentSeat == null)
     {
         if (!EnterRoom()) return false;
     }
     var index = CurrentRoom.Seats.IndexOf(seat);
     if (index < 0) return false;
     return _IsSuccess(Connection.ChangeSeat(index));
 }