• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IState类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IState的典型用法代码示例。如果您正苦于以下问题:C# IState类的具体用法?C# IState怎么用?C# IState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IState类属于命名空间,在下文中一共展示了IState类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: FetchNextInstruction

 public static Op FetchNextInstruction(IState state, ref ushort pc, ref ushort sp)
 {
     var firstWord = state.Get(pc++);
     return 0 == (firstWord & 0xF) ?
         (Op)DecodeNonBasic(state, firstWord, ref pc, ref sp) :
         (Op)DecodeBasic(state, firstWord, ref pc, ref sp);
 }
开发者ID:mmcgill,项目名称:dcpu_sharp,代码行数:7,代码来源:Dcpu.cs


示例2: EncounteredBlockageState

 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="tacticalBlockage"></param>
 /// <param name="currentState"></param>
 public EncounteredBlockageState(ITacticalBlockage tacticalBlockage, IState planningState, BlockageRecoveryDEFCON defcon, SAUDILevel saudi)
 {
     this.TacticalBlockage = tacticalBlockage;
     this.PlanningState = planningState;
     this.Saudi = saudi;
     this.Defcon = defcon;
 }
开发者ID:anand-ajmera,项目名称:cornell-urban-challenge,代码行数:12,代码来源:EncounteredBlockageState.cs


示例3: state_StateChanged

 static void state_StateChanged(IState newState)
 {
     state.StateChanged -= state_StateChanged;
     state = newState;
     state.StateChanged += state_StateChanged;
     state.Start();
 }
开发者ID:WadeTsai,项目名称:NetduinoDemo,代码行数:7,代码来源:Program.cs


示例4: StateInfo

 /// <summary>
 /// Constructs a <b>StateInfo</b> with the given configuration settings 
 /// and states collection.
 /// </summary>
 /// <param name="configSettings">The configuration settings.</param>
 /// <param name="states">The collection of states.</param>
 public StateInfo(
     Hashtable configSettings,
     IState[] states)
 {
     this.configSettings = configSettings;
     this.States = states;
 }
开发者ID:rogue-bit,项目名称:Triton-Framework,代码行数:13,代码来源:StateInfo.cs


示例5: OperationFailedException

 internal OperationFailedException(IReadOnlyList<IState> operationStates, IReadOnlyList<IState> successStates, IState actualState)
     : base($"Operation failed. Expected a transition from one of [{String.Join(", ", operationStates)}] to one of [{String.Join(", ", successStates)}], but actually reached {actualState}")
 {
     this.OperationStates = operationStates;
     this.SuccessStates = successStates;
     this.ActualState = actualState;
 }
开发者ID:canton7,项目名称:StateMechanic,代码行数:7,代码来源:OperationFailedException.cs


示例6: NewsCrawlerState

 public NewsCrawlerState(MachineContext context, IState prev)
     : base(context)
 {
     this.prev = prev;
     this._timer = new Util.StaticTimer(TimeSpan.FromMinutes(3));
     InitRssFeed();
 }
开发者ID:bajdcc,项目名称:NewsApp,代码行数:7,代码来源:NewsCrawlerState.cs


示例7: Set

		public void Set(AudioClip changeClip, float fadeTime, IState<PlayState> nextState)
		{
			this.audio.SwapSource();
			this.audio.main.clip = changeClip;
			this.fadeTime = fadeTime;
			this.nextState = nextState;
		}
开发者ID:K-Yoshiki,项目名称:menko,代码行数:7,代码来源:CrossFade.cs


示例8: StayInLaneState

 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="lane"></param>
 public StayInLaneState(ArbiterLane lane, Probability confidence, IState previous)
 {
     this.Lane = lane;
     this.internalLaneState = new InternalState(lane.LaneId, lane.LaneId, confidence);
     this.IgnorableWaypoints = new List<IgnorableWaypoint>();
     this.CheckPreviousState(previous);
 }
开发者ID:anand-ajmera,项目名称:cornell-urban-challenge,代码行数:11,代码来源:StayInLaneState.cs


示例9: StepHandler

 public void StepHandler(IState state)
 {
     //IEnumerable<AbstractStep> availableSteps = state.GetAvailableSteps();
     //BuildGraph(availableSteps);
     AbstractStep optimalStep = MakeDecision(state);
     _Game.DoStep(optimalStep, _PlayerType);
 }
开发者ID:porcellus,项目名称:KomponensAlapuJatek,代码行数:7,代码来源:MinimaxSearch.cs


示例10: GoldState

 public GoldState(IState state)
     : base(state)
 {
     Interest = 0.05m;
     LowerLimit = 1000m;
     UpperLimit = 10000000m;
 }
开发者ID:ryanwentzel,项目名称:DesignPatterns,代码行数:7,代码来源:GoldState.cs


示例11: Start

 public async Task Start(IState initialState, Session session,
     CancellationToken cancellationToken = default(CancellationToken))
 {
     Logging.Logger.Write("Version 1.0.5 : 2016.08.02 14:18", Logging.LogLevel.Self, ConsoleColor.Yellow);
     var state = initialState;
     do
     {
         try
         {
             state = await state.Execute(session, cancellationToken);
         }
         catch (InvalidResponseException)
         {
             session.EventDispatcher.Send(new ErrorEvent
             {
                 Message = "Niantic Servers unstable, throttling API Calls."
             });
         }
         catch (OperationCanceledException)
         {
             session.EventDispatcher.Send(new ErrorEvent { Message = "Current Operation was canceled." });
             state = _initialState;
         }
         catch (Exception ex)
         {
             session.EventDispatcher.Send(new ErrorEvent { Message = ex.ToString() });
             state = _initialState;
         }
     } while (state != null);
 }
开发者ID:yoogie27,项目名称:Pokemon-GO-Rare-Pokemon-Hunting-Farming-Bot,代码行数:30,代码来源:StateMachine.cs


示例12: Explore

        public override void Explore(IState state, string description)
        {
            _state = ((IQuantumState)state);
            this.Text = description;

            Start();
        }
开发者ID:fernandolucasrodriguez,项目名称:qit,代码行数:7,代码来源:ExplorerBlochSphere3D.cs


示例13: ChangeState

        public bool ChangeState(StateContext context, IState toState, string oldStateName)
        {
            try
            {
                var filterInfo = GetFilters(context.Job);

                var electStateContext = new ElectStateContext(context, toState, oldStateName);
                var electedState = ElectState(electStateContext, filterInfo.ElectStateFilters);

                var applyStateContext = new ApplyStateContext(context, electedState, oldStateName);
                ApplyState(applyStateContext, filterInfo.ApplyStateFilters);

                // State transition was succeeded.
                return true;
            }
            catch (Exception ex)
            {
                var failedState = new FailedState(ex)
                {
                    Reason = "An exception occurred during the transition of job's state"
                };

                var applyStateContext = new ApplyStateContext(context, failedState, oldStateName);

                // We should not use any state changed filters, because
                // some of the could cause an exception.
                ApplyState(applyStateContext, Enumerable.Empty<IApplyStateFilter>());

                // State transition was failed due to exception.
                return false;
            }
        }
开发者ID:atonse,项目名称:Hangfire,代码行数:32,代码来源:StateChangeProcess.cs


示例14: Find

        public virtual bool Find(IState initialState)
        {
            if (Strategy == null) return false;

            Strategy.Add(new Node(initialState));
            while (Strategy.Count() > 0)
            {
                var n = Strategy.Remove();
                if (n.Parent != null && n.Successor != null)
                {
                    var eventArgs = new StateExpansionEventArgs(n.Parent.State, n.Successor, n.Cost, n.Depth);
                    OnSuccessorExpanded(this, eventArgs);

                    if (eventArgs.CancelExpansion)
                        return false;
                }

                if (n.State.IsTerminal)
                {
                    CreateSolution(n);
                    return true;
                }

                foreach (var node in n.Expand(_closed))
                {
                    Strategy.Add(node);
                    if (_closed != null) _closed.Add(node.State);
                }

            }

            return false;
        }
开发者ID:haraldq,项目名称:grappr,代码行数:33,代码来源:SimpleSearch.cs


示例15: Enter

		public void Enter(IFiniteStateMachine stateMachine, IState oldState) {
			this.EditorForm.editorcontrol.MouseEnter += onMouseEnter;
			this.EditorForm.editorcontrol.MouseLeave += onMouseLeave;
			this.EditorForm.editorcontrol.MouseDown += onMouseDown;
			this.EditorForm.editorcontrol.MouseUp += onMouseUp;
			this.EditorForm.editorcontrol.MouseDoubleClick += onMouseDoubleClick;
		}
开发者ID:Hakua,项目名称:PokeSharp,代码行数:7,代码来源:EventTool.cs


示例16: Start

        void Start()
        {
            var idleState = new AIStateIdle(this, 0);
            var wanderState = new AIStateWander(this, 1);
            var combatState = new AIStateCombat(this, 2);
            var hideState = new AIStateHide(this, 3);
            var getHealthState = new AIStateGetHealth(this, 4);

            idleState.WanderID = wanderState.ID;
            idleState.CombatID = combatState.ID;
            idleState.GetHealthID = getHealthState.ID;

            idleState.TimeMax = 5f;

            wanderState.IdleID = idleState.ID;
            wanderState.CombatID = combatState.ID;
            wanderState.GetHealthID = getHealthState.ID;

            combatState.IdleID = idleState.ID;
            combatState.HideID = hideState.ID;

            hideState.IdleID = idleState.ID;

            getHealthState.IdleID = idleState.ID;

            states = new IState[]{idleState, wanderState, combatState, hideState, getHealthState};

            Begin(idleState);
        }
开发者ID:caseydedore,项目名称:VIP,代码行数:29,代码来源:AIHuman.cs


示例17: RedState

 public RedState(IState state)
     : base(state)
 {
     Interest = decimal.Zero;
     LowerLimit = -100m;
     UpperLimit = decimal.Zero;
 }
开发者ID:ryanwentzel,项目名称:DesignPatterns,代码行数:7,代码来源:RedState.cs


示例18: Start

 public async Task Start(IState initialState, Session session, CancellationToken cancellationToken = default(CancellationToken))
 {
     _ctx = session;
     var state = initialState;
     do
     {
         try
         {
             state = await state.Execute(session, cancellationToken);
         }
         catch (InvalidResponseException)
         {
             session.EventDispatcher.Send(new ErrorEvent { Message = "The PokemonGo servers are having a bad time, chill." });
         }
         catch (OperationCanceledException)
         {
             session.EventDispatcher.Send(new ErrorEvent { Message = "The bot was stopped." });
             return;
         }
         catch (Exception ex)
         {
             session.EventDispatcher.Send(new ErrorEvent { Message = ex.ToString() });
             state = _initialState;
         }
     } while (state != null);
 }
开发者ID:XEngine,项目名称:NecroBot,代码行数:26,代码来源:StateMachine.cs


示例19: Start

 public async Task Start(IState initialState, Session session,
     CancellationToken cancellationToken = default(CancellationToken))
 {
     var state = initialState;
     do
     {
         try
         {
             state = await state.Execute(session, cancellationToken);
         }
         catch (InvalidResponseException)
         {
             session.EventDispatcher.Send(new ErrorEvent
             {
                 Message = "Niantic Servers unstable, throttling API Calls."
             });
         }
         catch (OperationCanceledException)
         {
             session.EventDispatcher.Send(new ErrorEvent {Message = "Current Operation was canceled."});
             state = _initialState;
         }
         catch (Exception ex)
         {
             session.EventDispatcher.Send(new ErrorEvent {Message = ex.ToString()});
             state = _initialState;
         }
     } while (state != null);
 }
开发者ID:CalebD44,项目名称:NecroBot,代码行数:29,代码来源:StateMachine.cs


示例20: RegisterState

 public void RegisterState(string name, IState state)
 {
     if (!m_States.ContainsKey(name))
     {
         m_States[name] = state;
     }
 }
开发者ID:co-chi-tam,项目名称:The-Dark-Creature,代码行数:7,代码来源:FSMManager.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IStateProvinceService类代码示例发布时间:2022-05-24
下一篇:
C# IStTxtPara类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap