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