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


C# State.ToString方法代码示例

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


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

示例1: ChangeAnimation

    void ChangeAnimation(State animation) {
        m_currentAnimation = animation;

        //페이드 아웃 시에만 다른 애니메이션이 됩니다.
        if (m_currentAnimation == State.FadeOut) {
            //FadeOut_Rock, FadeOut_Paper, FadeOut_Scissor,
            string name = m_currentAnimation.ToString() + "_" + m_rpsKind.ToString();
            m_animation.Play(name);
        }
        else {
            m_animation.Play(m_currentAnimation.ToString());
        }
    }
开发者ID:fotoco,项目名称:006772,代码行数:13,代码来源:RPSPanel.cs

示例2: Start

    public void Start()
    {
        kathyBegginingSounds = GetComponent<Kathy_BeginningSounds>();

        states = Enum.GetValues(typeof(State)).Cast<State>().ToList();
        currentState = states.ElementAt(0);
        Debug.Log("State is now " + currentState.ToString());

        movingCamera.enabled = false;
    }
开发者ID:GGJPlayerOne,项目名称:ggjplayerone,代码行数:10,代码来源:GameController.cs

示例3: NotifyPrepared

 public void NotifyPrepared()
 {
     switch (_state)
     {
         case State.INIT:
             _state = State.PREPARED;
             _prepared.Signal();
             break;
         default:
             throw new InvalidOperationException(_state.ToString());
     }
 }
开发者ID:k3po,项目名称:k3po.dotnet,代码行数:12,代码来源:RoboticLatch.cs

示例4: Step

	// 初回の処理
	private void Step(State state) {
		_state = state;
		
		switch (_state) {
		case State.None: break;
		case State.StartServer: StepStartServer(); break;
		case State.WaitClient: StepWaitClient(); break;
		case State.ConnectToHost: StepConnectToHost(); break;
		case State.Connecting: StepConnecting(); break;
		default: throw new ArgumentOutOfRangeException(_state.ToString());
		}
	}
开发者ID:t13554yt,项目名称:CarMeter,代码行数:13,代码来源:GameSystem.cs

示例5: NotifyStartable

 public void NotifyStartable()
 {
     switch (_state)
     {
         case State.PREPARED:
             _state = State.STARTABLE;
             _startable.Signal();
             break;
         default:
             throw new InvalidOperationException(_state.ToString());
     }
 }
开发者ID:k3po,项目名称:k3po.dotnet,代码行数:12,代码来源:RoboticLatch.cs

示例6: Apply

        /// <summary>
        /// Applies the round in the forward direction (for encryption).
        /// </summary>
        /// <param name="state">The current state of the cipher.</param>
        /// <param name="keyIndex">The round key index to use.</param>
        public void Apply(State state, int keyIndex)
        {
            // Apply the layers in forward order
            for (int ixLayer = 0; ixLayer < _Layers.Length; ixLayer++)
            {
                _Layers[ixLayer].ApplyLayer(state, keyIndex);

                if(Debugging.IsEnabled)
                {
                    Debugging.Trace("After applying {0} in round {1}, the state is now:", _Layers[ixLayer], keyIndex);
                    Debugging.Trace(state.ToString());
                }
            }
        }
开发者ID:hartsock,项目名称:AES-Illustrated,代码行数:19,代码来源:Round.cs

示例7: Inverse

        /// <summary>
        /// Applies the round in the reverse direction (for decryption).
        /// </summary>
        /// <param name="state">The current state of the cipher.</param>
        /// <param name="keyIndex">The round key index to use.</param>
        public void Inverse(State state, int keyIndex)
        {
            // Apply the layers in reverse order
            for (int ixLayer = _Layers.Length - 1; ixLayer >= 0; ixLayer--)
            {
                _Layers[ixLayer].InverseLayer(state, keyIndex);

                if (Debugging.IsEnabled)
                {
                    Debugging.Trace("After applying {0} in round {1}, the state is now:", _Layers[ixLayer].ToString());
                    Debugging.Trace(state.ToString());
                }
            }
        }
开发者ID:hartsock,项目名称:AES-Illustrated,代码行数:19,代码来源:Round.cs

示例8: Write

        public static void Write(State s, String msg)
        {
            if (!Settings.Debug) return;
            while (isBeingUsed) ;

            lock (privateListToUseInLockToIndicateWhenFileIsBeingWrittenInto)
            {
                isBeingUsed = true;
                SanityCheck();
                System.IO.BinaryWriter sw = new BinaryWriter(new FileStream("debug/debug.log", FileMode.Append));
                sw.Write(Encode("[" + DateTime.Now.ToString() + "] " +
                    "[" + Debug.DebugInfo.FramesPerSecond.ToString() + "FPS] [" + Debug.DebugInfo.UpdatesPerSecond.ToString() + "TPS] " +
                    "[" + (System.Diagnostics.Process.GetCurrentProcess().WorkingSet64 / 1024 / 1024).ToString() + "mb] " +
                    "[" + s.ToString() + "]" +
                    " : " + msg + "\r\n"));
                sw.Close();
                sw.Dispose();
                isBeingUsed = false;
            }
        }
开发者ID:XZelnar,项目名称:MicroWorld,代码行数:20,代码来源:Log.cs

示例9: State

        public ActionResult State(State state)
        {
            PropertyPageViewModel propertyModel = new PropertyPageViewModel();

            var properties = ServiceLocator.GetPropertyService().GetProperties(state);

            propertyModel.CompleteProperties = properties.ToList().FindAll(o => o.IsComplete);
            propertyModel.InCompleteProperties = properties.ToList().FindAll(o => !o.IsComplete);
            propertyModel.State = state.ToString();

            if (this.Request.IsAjaxRequest())
            {
                return this.PartialView("PropertiesInState", propertyModel);
            }

            var model = new PageViewModel();
            model.View = "AustralianMap";
            model.Title = "Properties";
            model.SelectedNavigation = "Properties";
            model.Model = propertyModel;

            return View("StandardPageLayout", model);
        }
开发者ID:Brontsy,项目名称:Castlerock,代码行数:23,代码来源:PropertiesController.cs

示例10: ToString

 /// <summary>
 /// Convert typed State to raw string.
 /// </summary>
 /// <param name="state"></param>
 /// <returns></returns>
 public static string ToString(State state)
 {
     switch (state)
     {
         case State.Unknown:
             return "unknown";
         case State.Label:
             return "label";
         case State.Starred:
             return "starred";
         case State.Broadcast:
             return "broadcast";
         case State.Like:
             return "like";
         case State.Read:
             return "read";
         case State.Fresh:
             return "fresh";
         case State.ReadingList:
             return "reading-list";
         default:
             return state.ToString();
     }
 }
开发者ID:sted1234,项目名称:Code,代码行数:29,代码来源:StateFormatter.cs

示例11: ChangeAnimation

 void ChangeAnimation(State animation) {
     m_currentAnimation = animation;
     m_animation.Play(m_currentAnimation.ToString());
 }
开发者ID:fotoco,项目名称:006772,代码行数:4,代码来源:BattlePanel.cs

示例12: GetSuccessors

 public State[] GetSuccessors(State fromState)
 {
     var from = LogicOperations.NodeFromString(fromState.ToString());
     return SetToStates(LogicOperations.GetSuccessors(historyGraph, from));
 }
开发者ID:Harriet92,项目名称:TemporalRPGSystem,代码行数:5,代码来源:LogicEngine.cs

示例13: Update

 public void Update(State state)
 {
     State = state;
     Message = state.ToString();
     if (state == LoadBalancer.State.Stopped)
         Color = Color.Red;
     if (state == LoadBalancer.State.Starting)
         Color = Color.Orange;
     if (state == LoadBalancer.State.Failed)
         Color = Color.Red;
     if (state == LoadBalancer.State.Running)
         Color = Color.Green;
     if (state == LoadBalancer.State.Stopping)
         Color = Color.Orange;
     if (Changed != null)
         Changed(null, null);
 }
开发者ID:SortByte,项目名称:Network-Manager,代码行数:17,代码来源:LoadBalancer.cs

示例14: CreateBehavior

        public static Composite CreateBehavior(Composite jumpturnAttack)
        {
            return
                new PrioritySelector(
                    new Decorator(
                        ret => jstate != State.None,
                        new PrioritySelector(
                // add sanity checks here to test if jump should continue
                            new Decorator(ret => !StyxWoW.Me.IsAlive, new Action(ret => EndJumpTurn("JT: I am dead, cancelling"))),
                            new Decorator(ret => StyxWoW.Me.Rooted || StyxWoW.Me.IsRooted(), new Action(ret => EndJumpTurn("JT: I am rooted, cancelling"))),
                            new Decorator(ret => StyxWoW.Me.Stunned || StyxWoW.Me.IsStunned(), new Action(ret => EndJumpTurn("JT: I am stunned, cancelling"))),

                            new Decorator(ret => jstate == State.Jump,
                                new Sequence(
                                    new Action(delegate
            {
                // jump up
                Logger.WriteDebug(Color.Cyan, "JT: enter Jump state");
                WoWMovement.Move(WoWMovement.MovementDirection.JumpAscend);
            }),
                                    new WaitContinue(new TimeSpan(0, 0, 0, 0, 100), ret => false, new ActionAlwaysSucceed()),
                                    new PrioritySelector(
                                        new Wait(new TimeSpan(0, 0, 0, 0, 250), ret => StyxWoW.Me.MovementInfo.IsAscending || StyxWoW.Me.MovementInfo.IsDescending || StyxWoW.Me.MovementInfo.IsFalling, new ActionAlwaysSucceed()),
                                        new Action(ret => { EndJumpTurn("JT: timed out waiting for JumpAscend to occur"); return RunStatus.Failure; })
                                        ),
                                    new Action(delegate
            {
                Logger.WriteDebug(Color.Cyan, "JT: transition from Jump to Face");
                jstate = State.Face;
            })
                                    )
                                ),
                            new Decorator(ret => jstate == State.Face,
                                new Sequence(
                                    new Action(ret => StyxWoW.Me.SetFacing(StyxWoW.Me.CurrentTarget)),
                                    new PrioritySelector(
                                        new Wait(new TimeSpan(0, 0, 0, 0, 500), ret => StyxWoW.Me.IsSafelyFacing(StyxWoW.Me.CurrentTarget, 20f), new ActionAlwaysSucceed()),
                                        new Action(ret => Logger.WriteDebug("JT: timed out waiting for SafelyFacing to occur"))
                                        ),
                                    new Action(delegate
            {
                WoWMovement.StopFace();
                if (StyxWoW.Me.IsSafelyFacing(StyxWoW.Me.CurrentTarget, 20f))
                {
                    Logger.WriteDebug(Color.Cyan, "JT: transition from Face to Attack");
                    jstate = State.Attack;
                }
                else
                {
                    Logger.WriteDebug(Color.Cyan, "JT: transition from Face to FaceRestore");
                    jstate = State.FaceRestore;
                }
            })
                                    )
                                ),
                            new Decorator(ret => jstate == State.Attack,
                                new PrioritySelector(
                                    new Sequence(
                                        new ActionDebugString("JT: entering Attack behavior"),
                                        jumpturnAttack ?? new ActionAlwaysFail(),
                                        new ActionAlwaysFail()
                                        ),
                                    new Action(delegate
            {
                Logger.WriteDebug(Color.Cyan, "JT: transition from Attack to FaceRestore");
                jstate = State.FaceRestore;
            })
                                    )
                                ),
                            new Decorator(ret => jstate == State.FaceRestore,
                                new Sequence(
                /*
                                                    new Action( ret => StyxWoW.Me.SetFacing( originalFacing)),
                                                    new WaitContinue( new TimeSpan(0,0,0,0,250), ret => StyxWoW.Me.IsDirectlyFacing(originalFacing), new ActionAlwaysSucceed()),
                */
                                    new Action(ret => Navigator.MoveTo(Kite.safeSpot)),
                                    new WaitContinue(new TimeSpan(0, 0, 0, 0, 250), ret => StyxWoW.Me.IsDirectlyFacing(originalFacing), new ActionAlwaysSucceed()),

                                    new Action(delegate
            {
                Logger.WriteDebug(Color.Cyan, "JT: transition from FaceRestore to EndJump");
                WoWMovement.StopFace();
                jstate = State.EndJump;
            })
                                    )
                                ),
                            new Decorator(ret => jstate == State.EndJump,
                                new Action(delegate
            {
                EndJumpTurn("JT: transition from EndJump to None");
            })
                                ),

                            new Action(ret => Logger.WriteDebug(Color.Cyan, "JT: fell through with state {0}", jstate.ToString()))
                            )
                        ),
                    new Decorator(
                        ret => IsJumpTurnNeeded(),
                        new Action(delegate
            {
//.........这里部分代码省略.........
开发者ID:Asphodan,项目名称:Alphabuddy,代码行数:101,代码来源:Kite.cs

示例15: _requireState

 /// <summary>
 /// Checks to make sure that the port is in <paramref name="state" />
 /// </summary>
 /// <param name="state">The state to require</param>
 private void _requireState(State state)
 {
     if(_state != state)
     {
         throw new Exception("Can't perform the desired operation in " + state.ToString() + " state");
     }
 }
开发者ID:LorenVS,项目名称:bacstack,代码行数:11,代码来源:ForeignDevicePort.cs


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