本文整理汇总了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());
}
}
示例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;
}
示例3: NotifyPrepared
public void NotifyPrepared()
{
switch (_state)
{
case State.INIT:
_state = State.PREPARED;
_prepared.Signal();
break;
default:
throw new InvalidOperationException(_state.ToString());
}
}
示例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());
}
}
示例5: NotifyStartable
public void NotifyStartable()
{
switch (_state)
{
case State.PREPARED:
_state = State.STARTABLE;
_startable.Signal();
break;
default:
throw new InvalidOperationException(_state.ToString());
}
}
示例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());
}
}
}
示例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());
}
}
}
示例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;
}
}
示例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);
}
示例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();
}
}
示例11: ChangeAnimation
void ChangeAnimation(State animation) {
m_currentAnimation = animation;
m_animation.Play(m_currentAnimation.ToString());
}
示例12: GetSuccessors
public State[] GetSuccessors(State fromState)
{
var from = LogicOperations.NodeFromString(fromState.ToString());
return SetToStates(LogicOperations.GetSuccessors(historyGraph, from));
}
示例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);
}
示例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
{
//.........这里部分代码省略.........
示例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");
}
}