Exemplo n.º 1
0
        virtual public async void Choice()
        {
            TInfo.Text                = "";
            TInfo.MediaSource         = null;
            TInfo.QuestionContentType = QuestionContentType.Text;
            TInfo.Sound               = false;

            foreach (var item in _data.Players)
            {
                item.State = PlayerState.None;
            }

            var select = false;

            lock (_data.ChoiceLock)
            {
                lock (TInfo.RoundInfoLock)
                {
                    if (_data.ThemeIndex > -1 && _data.ThemeIndex < TInfo.RoundInfo.Count &&
                        _data.QuestionIndex > -1 && _data.QuestionIndex < TInfo.RoundInfo[_data.ThemeIndex].Questions.Count)
                    {
                        select = true;
                    }
                }
            }

            if (!select)
            {
                return;
            }

            try
            {
                await TInfo.PlaySimpleSelectionAsync(_data.ThemeIndex, _data.QuestionIndex);
            }
            catch (Exception exc)
            {
                _viewerActions.Client.CurrentServer.OnError(exc, false);
            }
        }
Exemplo n.º 2
0
 public void PlaySimpleSelection(int theme, int quest) => TInfo.PlaySimpleSelectionAsync(theme, quest);