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


C# IState类代码示例

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


IState类属于命名空间,在下文中一共展示了IState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: JsonWriter

 /// <summary>
 /// Creates a json writer that writes to the <paramref name="writer"/> and uses
 /// the InvariantCulture for any formatting.
 /// </summary>
 /// <param name="writer">the text writer that will be written to</param>
 /// <param name="indent">setting that specifies whether to indent</param>
 /// <param name="culture">The culture to use for formatting</param>
 public JsonWriter(TextWriter writer, bool indent, CultureInfo culture)
 {
     this._writer = writer;
     _currentState = new InitialState(this);
     if (!indent)
         indentSize = 0;
 }
开发者ID:Letractively,项目名称:gabesworkshop,代码行数:14,代码来源:JsonWriter.cs


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