public void changeState(IRoomState state) { lock (_roomState) { _roomState = state; } OnChanged(new RoomChangedEventArgs(this)); }
public Room(int?playersMaxCount = null) { PlayersMaxCount = playersMaxCount; if (isPublic() && playersMaxCount < PlayersMinCount) { throw new Exception(""); } Guid = Guid.NewGuid(); Players = new List <User>(); MakedMovePlayerIds = new List <int>(); _roomState = new WaitingPlayersState(this); }
public void change_state(ROOM_STATE_TYPE state) { this.current_room_state = this.room_states[state]; }