Exemplo n.º 1
0
        /// <summary>
        /// Yields the experiment as a sequence of views
        /// </summary>
        public override IEnumerator <View> GetEnumerator()
        {
            // wait to begin
            yield return(new ChoiceView(new string[] { "Click anywhere to begin" }));

            var connected = new VolatileBool(true); // assume it's connected

            using (var invoker = new SingleThreadedInvoker())
                using (var connectionListener = new EEGDataListener(invoker, s => connected.value = true, null, s => connected.value = false))
                    using (var logger = this.LogExperimentAndGetLogger()) // log the experiment
                        using (var trialLogger = this.GetTrialWriter())   // logs each trial
                        {
                            // create the runtime
                            var runtime = new Runtime(this)
                            {
                                Classifiers = this.ClassificationSchemes.Select(cs => new ClassifierManager(cs)).ToIArray(),
                                Logger      = logger,
                                TrialLogger = trialLogger,
                            };

                            // listen for a broken connection
                            this.DataSource.AddListener(connectionListener);

                            foreach (var view in this.GetViews(runtime))
                            {
                                if (connected.value)
                                {
                                    yield return(view);
                                }
                                else
                                {
                                    GUIUtils.Alert(runtime.LogLine("Lost connection to headset!"));
                                    break;
                                }
                            }

                            this.DataSource.RemoveListener(connectionListener);
                        }
        }
Exemplo n.º 2
0
        public AssaultBotServer(VolatileBool working, int delay, Dictionary<string, WowForPartyMemberHealerCD> party_data, VolatileBool PriestHealAssist, VolatileBool AbolishDisease, VolatileBool DispellMagic, VolatileBool DispellCurse)
        {
            AssaultBotServer.party_data = party_data;
            AssaultBotServerVariables.working = working;
            this.PriestHealAssist = PriestHealAssist;
            this.AbolishDisease = AbolishDisease;
            this.DispellMagic = DispellMagic;
            this.DispellCurse = DispellCurse;
            AssaultBotServerVariables.delay = delay;

            priest = new DDPriestAssist(delay,party_data);
            mage = new DDMageAssist(delay,party_data);
        }
Exemplo n.º 3
0
 public PartyDataRetrivalServer(VolatileBool working, Dictionary<string, WowForPartyMemberHealerCD> party_data)
 {
     PartyDataRetrivalServerVariables.working = working;
     PartyDataRetrivalServerVariables.party_data = party_data;
 }