Inheritance: ViewModelBase
Exemple #1
0
 public void RemoveSeat(SeatViewModel seat)
 {
     LeftSeats.Remove(seat);
     RightSeats.Remove(seat);
     Seats.Remove(seat);
     Trace.Assert(LeftSeats.Count + RightSeats.Count == Seats.Count);
 }
Exemple #2
0
        public bool KickPlayer(SeatViewModel seat)
        {
            var index = CurrentRoom.Seats.IndexOf(seat);

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

            if (index < 0)
            {
                return(false);
            }
            return(_IsSuccess(Connection.CloseSeat(index)));
        }
Exemple #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)));
        }
Exemple #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);
 }
 public void RemoveSeat(SeatViewModel seat)
 {
     LeftSeats.Remove(seat);
     RightSeats.Remove(seat);
     Seats.Remove(seat);
     Trace.Assert(LeftSeats.Count + RightSeats.Count == Seats.Count);
 }
 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);
 }
Exemple #8
0
 public bool OpenSeat(SeatViewModel seat)
 {
     return _IsSuccess(Connection.OpenSeat(LoginToken, CurrentRoom.Seats.IndexOf(seat)));
 }
Exemple #9
0
 public bool KickPlayer(SeatViewModel seat)
 {
     return _IsSuccess(Connection.Kick(LoginToken, CurrentRoom.Seats.IndexOf(seat)));
 }
Exemple #10
0
 public bool JoinSeat(SeatViewModel seat)
 {
     if (CurrentSeat == null)
     {
         if (!EnterRoom()) return false;
     }
     return _IsSuccess(Connection.ChangeSeat(LoginToken, CurrentRoom.Seats.IndexOf(seat)));
 }
 public bool OpenSeat(SeatViewModel seat)
 {
     var index = CurrentRoom.Seats.IndexOf(seat);
     if (index < 0) return false;
     return _IsSuccess(Connection.OpenSeat(index));
 }
 public bool KickPlayer(SeatViewModel seat)
 {
     var index = CurrentRoom.Seats.IndexOf(seat);
     if (index < 0) return false;
     return _IsSuccess(Connection.Kick(index));
 }
 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));
 }