当前位置: 首页>>代码示例>>C#>>正文


C# LiveSplitState.SetGameTime方法代码示例

本文整理汇总了C#中LiveSplit.Model.LiveSplitState.SetGameTime方法的典型用法代码示例。如果您正苦于以下问题:C# LiveSplitState.SetGameTime方法的具体用法?C# LiveSplitState.SetGameTime怎么用?C# LiveSplitState.SetGameTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LiveSplit.Model.LiveSplitState的用法示例。


在下文中一共展示了LiveSplitState.SetGameTime方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Update

        public override void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode)
        {
            if (state.CurrentPhase == TimerPhase.NotRunning)
            {
                if (AutoSplitter.ShouldStart(state))
                {
                    Model.Start();
                }
            }
            else if (state.CurrentPhase == TimerPhase.Running || state.CurrentPhase == TimerPhase.Paused)
            {
                if (AutoSplitter.ShouldReset(state))
                {
                    Model.Reset();
                    return;
                }
                else if (AutoSplitter.ShouldSplit(state))
                {
                    Model.Split();
                }

                state.IsGameTimePaused = AutoSplitter.IsGameTimePaused(state);

                var gameTime = AutoSplitter.GetGameTime(state);
                if (gameTime != null)
                    state.SetGameTime(gameTime);
            }
        }
开发者ID:Rezura,项目名称:LiveSplit,代码行数:28,代码来源:AutoSplitComponent.cs

示例2: Update

        public void Update(LiveSplitState lsState)
        {
            if (Game != null && !Game.HasExited)
            {
                OldState = State.RefreshValues(Game);

                if (lsState.CurrentPhase == TimerPhase.Running || lsState.CurrentPhase == TimerPhase.Paused)
                {
                    var isPaused = IsLoading.Run(lsState, OldState, State);
                    if (isPaused != null)
                        lsState.IsGameTimePaused = isPaused;

                    var gameTime = GameTime.Run(lsState, OldState, State);
                    if (gameTime != null)
                        lsState.SetGameTime(gameTime);

                    if (Reset.Run(lsState, OldState, State) ?? false)
                    {
                        Model.Reset();
                    }
                    else if (Split.Run(lsState, OldState, State) ?? false)
                    {
                        Model.Split();
                    }
                }

                if (lsState.CurrentPhase == TimerPhase.NotRunning)
                {
                    if (Start.Run(lsState, OldState, State) ?? false)
                    {
                        Model.Start();
                    }
                }
            }
            else
            {
                if (Model == null)
                {
                    Model = new TimerModel() { CurrentState = lsState };
                }
                TryConnect();
            }
        }
开发者ID:0xwas,项目名称:LiveSplit.ScriptableAutoSplit,代码行数:43,代码来源:ASLScript.cs

示例3: RunUpdate

        public void RunUpdate(LiveSplitState lsState)
        {
            if (Game != null && !Game.HasExited)
            {
                OldState = State.RefreshValues(Game);

                string ver = Version;
                runMethod(Update, lsState, ref ver);

                if (lsState.CurrentPhase == TimerPhase.Running || lsState.CurrentPhase == TimerPhase.Paused)
                {
                    if (UsesGameTime && !lsState.IsGameTimeInitialized)
                        Model.InitializeGameTime();

                    var isPaused = runMethod(IsLoading, lsState, ref ver);
                    if (isPaused != null)
                        lsState.IsGameTimePaused = isPaused;

                    var gameTime = runMethod(GameTime, lsState, ref ver);
                    if (gameTime != null)
                        lsState.SetGameTime(gameTime);

                    if (runMethod(Reset, lsState, ref ver) ?? false)
                    {
                        Model.Reset();
                    }
                    else if (runMethod(Split, lsState, ref ver) ?? false)
                    {
                        Model.Split();
                    }
                }

                if (lsState.CurrentPhase == TimerPhase.NotRunning)
                {
                    if (runMethod(Start, lsState, ref ver) ?? false)
                    {
                        Model.Start();
                    }
                }
            }
            else
            {
                if (Model == null)
                {
                    Model = new TimerModel() { CurrentState = lsState };
                }
                TryConnect(lsState);
            }
        }
开发者ID:glasnonck,项目名称:LiveSplit.ScriptableAutoSplit,代码行数:49,代码来源:ASLScript.cs

示例4: DoUpdate

        // This is executed repeatedly as long as the game is connected and initialized.
        private void DoUpdate(LiveSplitState state)
        {
            _old_state = _state.RefreshValues(_game);

            if (!(RunMethod(_methods.update, state) ?? true))
            {
                // If Update explicitly returns false, don't run anything else
                return;
            }

            if (state.CurrentPhase == TimerPhase.Running || state.CurrentPhase == TimerPhase.Paused)
            {
                if (_uses_game_time && !state.IsGameTimeInitialized)
                    _timer.InitializeGameTime();

                var is_paused = RunMethod(_methods.isLoading, state);
                if (is_paused != null)
                    state.IsGameTimePaused = is_paused;

                var game_time = RunMethod(_methods.gameTime, state);
                if (game_time != null)
                    state.SetGameTime(game_time);

                if (RunMethod(_methods.reset, state) ?? false)
                {
                    if (_settings.GetBasicSettingValue("reset"))
                        _timer.Reset();
                }
                else if (RunMethod(_methods.split, state) ?? false)
                {
                    if (_settings.GetBasicSettingValue("split"))
                        _timer.Split();
                }
            }

            if (state.CurrentPhase == TimerPhase.NotRunning)
            {
                if (RunMethod(_methods.start, state) ?? false)
                {
                    if (_settings.GetBasicSettingValue("start"))
                        _timer.Start();
                }
            }
        }
开发者ID:tduva,项目名称:LiveSplit.ScriptableAutoSplit,代码行数:45,代码来源:ASLScript.cs

示例5: Update

        public void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode)
        {
            // hack to prevent flicker, doesn't actually pause anything
            state.IsGameTimePaused = true;

            // Update is called every 25ms, so up to 25ms IGT can be lost if using delay and no auto-start
            if (_waitingForDelay)
            {
                if (state.CurrentTime.RealTime >= TimeSpan.Zero)
                {
                    _sessionTimeOffset = _sessionTime;
                    _waitingForDelay = false;
                }
                else
                {
                    state.SetGameTime(state.CurrentTime.RealTime);
                }
            }

            if (!_waitingForDelay)
                // update game time, don't show negative time due to tick adjusting
                state.SetGameTime(this.GameTime >= TimeSpan.Zero ? this.GameTime : TimeSpan.Zero);

            if (!this.Settings.ShowGameTime)
                return;

            this.InternalComponent.TimeValue =
                state.CurrentTime[state.CurrentTimingMethod == TimingMethod.GameTime
                    ? TimingMethod.RealTime : TimingMethod.GameTime];
            this.InternalComponent.InformationName = state.CurrentTimingMethod == TimingMethod.GameTime
                ? "Real Time" : "Game Time";

            _cache.Restart();
            _cache["TimeValue"] = this.InternalComponent.ValueLabel.Text;
            _cache["TimingMethod"] = state.CurrentTimingMethod;
            if (invalidator != null && _cache.HasChanged)
                invalidator.Invalidate(0f, 0f, width, height);
        }
开发者ID:RedHaze,项目名称:sourcesplit,代码行数:38,代码来源:SourceSplitComponent.cs


注:本文中的LiveSplit.Model.LiveSplitState.SetGameTime方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。