コード例 #1
0
        public ConditionTrigger(Core core, string name)
        {
            mCore         = core;
            mTickListener = new Action(mCoordinator_Tick);

#if DEBUG
            StatisticsCollection.AddStatistics(mStatistics, name + " Trigger");
        #endif
        }
コード例 #2
0
ファイル: MousePlugin.cs プロジェクト: veyvin/ChimeraClean
        public MousePlugin()
        {
            PluginConfig cfg = new PluginConfig();

            mTickListener = new Action(mCore_Tick);

#if DEBUG
            StatisticsCollection.AddStatistics(mStatistics, "Mouse Plugin");
#endif
        }
コード例 #3
0
ファイル: KBMousePlugin.cs プロジェクト: veyvin/ChimeraClean
        public KBMousePlugin()
        {
            PluginConfig cfg = new PluginConfig();

            mEnabled = cfg.KeyboardEnabled;

            mTickListener = new Action(mCoordinator_Tick);

#if DEBUG
            StatisticsCollection.AddStatistics(mStatistics, Name);
#endif
        }
コード例 #4
0
        /// <summary>
        /// Initialise the fade transition, specifying how long the fade should last, in ms.
        /// </summary>
        /// <param name="transition">The transition this fade is part of.</param>
        /// <param name="manager">The window this fade is to be drawn on.</param>
        /// <param name="lengthMS">The length of time, in ms, the fade should last.</param>
        public OpacityFadeWindowTransition(StateTransition transition, FrameOverlayManager manager, double lengthMS, bool fadeIn)
            : base(transition, manager)
        {
            mLengthMS     = lengthMS;
            mFadeIn       = fadeIn;
            mTickListener = new Action(Coordinator_Tick);

            Finished += new Action <IWindowTransition>(OpacityFadeWindowTransition_Finished);

#if DEBUG
            StatisticsCollection.AddStatistics(mStatistics, transition.Name + " " + manager.Name);
#endif
        }
コード例 #5
0
ファイル: GamepadManager.cs プロジェクト: veyvin/ChimeraClean
        public static void Init(ITickSource source)
        {
            if (!sTracking)
            {
                GetController();
                source.Tick += new Action(source_Tick);
                sTracking    = true;

#if DEBUG
                StatisticsCollection.AddStatistics(sStatistics, "GamepadManager");
#endif
            }
        }
コード例 #6
0
ファイル: AxisBasedDelta.cs プロジェクト: veyvin/ChimeraClean
        /// <summary>
        /// Input axes will automatically be assigned to camera axes if no axis is specified.
        /// The ordering is as follows:
        /// 1st axis: x
        /// 2nd axis: y
        /// 3rd axis: z
        /// 4th axis: pitch
        /// 5th axis : yaw
        /// Specify null if you do not which to assign that axis.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="axes"></param>
        public AxisBasedDelta(string name, AxisConfig config, params IAxis[] axes)
        {
            Logger  = LogManager.GetLogger(name);
            mName   = name;
            mConfig = config;

            mTickListener = new Action(mCore_Tick);

            foreach (var axis in axes)
            {
                if (axis != null)
                {
                    AddAxis(axis);
                }
            }

#if DEBUG
            StatisticsCollection.AddStatistics(mStatistics, name);
#endif
        }
コード例 #7
0
        public Step(FlythroughState state, XmlNode node, Text subtitlesText, int subtitleTimeoutS, IMediaPlayer player)
        {
            if (node.Attributes["St››ep"] == null && !int.TryParse(node.Attributes["Step"].Value, out mStep))
            {
                throw new ArgumentException("Unable to load slideshow step. A valid 'Step' attribute must be supplied.");
            }

#if DEBUG
            if (sStatistics == null)
            {
                sStatistics = new TickStatistics();
                StatisticsCollection.AddStatistics(sStatistics, "Flythrough Steps");
            }
#endif

            mPlayer  = player;
            mManager = state.Manager;
            mStep    = GetInt(node, -1, "Step");
            if (mStep == -1)
            {
                throw new ArgumentException("Unable to load step ID. A valid Step attribute is expected.");
            }

            XmlAttribute voiceoverAttribute = node.Attributes["Voiceover"];
            if (voiceoverAttribute != null && File.Exists(Path.GetFullPath(voiceoverAttribute.Value)))
            {
                if (mPlayer != null)
                {
                    mVoiceoverFile = Path.GetFullPath(voiceoverAttribute.Value);
                }
                else
                {
                    Logger.Warn("Unable to load voiceover for flythrough step. No MediaPlayer supplied.");
                }
            }

            mSubtitlesText = subtitlesText;

            XmlNode newFontNode = node.SelectSingleNode("child::SubtitlesFont");
            if (newFontNode != null)
            {
                mNewSubtitlesFont = state.Manager.MakeText(newFontNode);
            }

            if (mSubtitlesText != null)
            {
                mTickListener     = new Action(mCoordinator_Tick);
                mSubtitleTimeoutS = subtitleTimeoutS;
                XmlNode subtitlesNode = node.SelectSingleNode("child::Subtitles");
                if (subtitlesNode != null)
                {
                    foreach (XmlNode child in subtitlesNode.ChildNodes)
                    {
                        if (child is XmlElement)
                        {
                            double time = child.Attributes["Time"] != null?double.Parse(child.Attributes["Time"].Value) : 0;

                            mSubtitles.Add(time, child.InnerText.Trim('\n', ' ', Environment.NewLine[0]).Replace("  ", ""));
                        }
                    }
                }
            }

            foreach (var featureNode in GetChildrenOfChild(node, "Features"))
            {
                IFeature feature = mManager.GetFeature(featureNode, "flythrough step " + (mStep + 1), null);
                if (feature != null)
                {
                    mFeatures.Add(feature);
                    state.AddFeature(feature);
                    feature.Active = false;
                }
            }
        }