예제 #1
0
        public void Start([NotNull] string name, [NotNull] IAmplitudeProvider micAmplitude, [NotNull] Rooms rooms, [NotNull] RoomChannels roomChannels, [NotNull] PlayerChannels playerChannels, [NotNull] ILossEstimator loss)
        {
            if (name == null)
            {
                throw new ArgumentException("name");
            }
            if (micAmplitude == null)
            {
                throw new ArgumentException("micProvider");
            }
            if (rooms == null)
            {
                throw new ArgumentNullException("rooms");
            }
            if (roomChannels == null)
            {
                throw new ArgumentException("roomChannels");
            }
            if (playerChannels == null)
            {
                throw new ArgumentException("playerChannels");
            }
            if (loss == null)
            {
                throw new ArgumentException("playerChannels");
            }

            Local = new LocalVoicePlayerState(name, micAmplitude, rooms, roomChannels, playerChannels, loss);

            Add(Local);
        }
예제 #2
0
        public LocalVoicePlayerState(string name, [NotNull] IAmplitudeProvider micAmplitude, [NotNull] Rooms rooms, [NotNull] RoomChannels roomChannels, [NotNull] PlayerChannels playerChannels, [NotNull] ILossEstimator loss, [NotNull] ICommsNetwork network)
            : base(name)
        {
            _rooms          = rooms;
            _micAmplitude   = micAmplitude;
            _roomChannels   = roomChannels;
            _playerChannels = playerChannels;
            _loss           = loss;
            _network        = network;

            rooms.JoinedRoom             += OnLocallyEnteredRoom;
            rooms.LeftRoom               += OnLocallyExitedRoom;
            roomChannels.OpenedChannel   += OnChannelOpened;
            roomChannels.ClosedChannel   += OnChannelClosed;
            playerChannels.OpenedChannel += OnChannelOpened;
            playerChannels.ClosedChannel += OnChannelClosed;
        }
예제 #3
0
        public LocalVoicePlayerState(string name, [NotNull] IAmplitudeProvider micAmplitude, [NotNull] Rooms rooms, [NotNull] RoomChannels roomChannels, [NotNull] PlayerChannels playerChannels)
            : base(name)
        {
            _rooms          = rooms;
            _micAmplitude   = micAmplitude;
            _roomChannels   = roomChannels;
            _playerChannels = playerChannels;

            rooms.JoinedRoom             += OnLocallyEnteredRoom;
            rooms.LeftRoom               += OnLocallyExitedRoom;
            roomChannels.OpenedChannel   += OnChannelOpened;
            roomChannels.ClosedChannel   += OnChannelClosed;
            playerChannels.OpenedChannel += OnChannelOpened;
            playerChannels.ClosedChannel += OnChannelClosed;
        }