public INetworkState GetNetworkState(NetworkStateId id) { return(id switch { NetworkStateId.NotConnected => NotConnected, NetworkStateId.PendingLogOn => PendingLogOn, NetworkStateId.WaitingForBoard => WaitingForBoard, NetworkStateId.PendingBoard => PendingBoard, NetworkStateId.WaitingForGame => WaitingForGame, NetworkStateId.FoundGame => FoundGame, NetworkStateId.InitialGame => InitialGame, NetworkStateId.MyTurn => MyTurn, NetworkStateId.TheirTurn => TheirTurn, NetworkStateId.Waiting => Waiting, _ => throw new ArgumentOutOfRangeException(nameof(id), id, null) });
/// <summary> /// Update the state of the conversation. /// </summary> /// <param name="id"></param> public void SetState(NetworkStateId id) { _state = _container.GetNetworkState(id); }