Esempio n. 1
0
        public void handleUserNotADogAction(User user)
        {
            lock (MakedMovePlayerIds)
            {
                if (_roomState.getStateCode() != nameof(PlayingState))
                {
                    throw new Exception("");
                }
                MakedMovePlayerIds.Add(user.Id);
                _roomState.handleUserNotADogAction(user);
            }

            OnChanged(new RoomChangedEventArgs(this));
        }
Esempio n. 2
0
        public void replay(User user)
        {
            if (RootId != user.Id)
            {
                throw new Exception("");
            }
            if (_roomState.getStateCode() != nameof(EndState))
            {
                throw new Exception("");
            }

            lock (MakedMovePlayerIds)
            {
                MakedMovePlayerIds.Clear();
            }

            changeState(new WaitingPlayersState(this));
        }