本文整理汇总了C#中Phase类的典型用法代码示例。如果您正苦于以下问题:C# Phase类的具体用法?C# Phase怎么用?C# Phase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Phase类属于命名空间,在下文中一共展示了Phase类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ClientReceive
public static double ClientReceive()
{
double t = clientBuffer;
clientBuffer = EmptyBuffer;
phase = Phase.Send;
return t;
}
开发者ID:juhan,项目名称:NModel,代码行数:7,代码来源:ClientServer.cs
示例2: Update
public override string Update(Job job, Phase phase, string body = null, string contentType = null, string accept = null)
{
job.UpdateState(JobStateType.INPROGRESS, "UPDATE to " + phase.Name);
string response;
if (!contentType.ToLower().Equals("application/xml"))
{
response = "Invalid Content-Type, expecting application/xml";
job.UpdatePhaseState(phase.Name, PhaseStateType.FAILED, response);
throw new RejectedException(response);
}
LearnerPersonal data;
try {
data = SerialiserFactory.GetXmlSerialiser<LearnerPersonal>().Deserialise(body);
} catch(Exception e)
{
response = "Error decoding xml data: " + e.Message;
job.UpdatePhaseState(phase.Name, PhaseStateType.FAILED, response);
throw new RejectedException(response, e);
}
NameType name = data.PersonalInformation.Name;
job.UpdatePhaseState(phase.Name, PhaseStateType.COMPLETED, "UPDATE");
response = "Got UPDATE message for " + phase.Name + "@" + job.Id + " with content type " + contentType + " and accept " + accept + ".\nGot record for learner:" + name.GivenName + " " + name.FamilyName;
return response;
}
开发者ID:ZiNETHQ,项目名称:sif3-framework-dotnet,代码行数:26,代码来源:XmlActions.cs
示例3: GetSpeedCommand
public OperationalSpeedCommand GetSpeedCommand()
{
OperationalVehicleState vs = Services.StateProvider.GetVehicleState();
OperationalSpeedCommand cmd = new OperationalSpeedCommand();
cmd.brakePressure = TahoeParams.brake_hold;
cmd.engineTorque = 0;
if (result != CompletionResult.Failed) {
if (phase == Phase.Braking) {
// chek if we can transition to shifting
if (Math.Abs(vs.speed) < 0.05 && vs.brakePressure >= TahoeParams.brake_hold-1) {
phase = Phase.Shifting;
}
}
if (phase == Phase.Shifting) {
cmd.transGear = gear;
if (vs.transGear == gear) {
result = CompletionResult.Completed;
}
}
}
return cmd;
}
开发者ID:anand-ajmera,项目名称:cornell-urban-challenge,代码行数:26,代码来源:ShiftSpeedCommand.cs
示例4: OnACK_UpdateWindow
internal override void OnACK_UpdateWindow(RUDPOutgoingPacket packet)
{
//---- Reset
_outOfOrderCount = 0;
//---- Check the phase
if (CWND <= _ssthresh)
Phase = Phase.SlowStart;
else
Phase = Phase.CongestionAvoidance;
//---- Slow start
if (Phase == Phase.SlowStart)
{
// Exponential grow
CWND += _rudp.MTU;
}
//---- Congestion avoidance
if (Phase == Phase.CongestionAvoidance)
{
// (increase of 1 packet every RTT)
// This is a linear growth of cwnd.
CWND += (_rudp.MTU * _rudp.MTU) / CWND;
}
//---- Check boundaries
CWND = Math.Max(Math.Min(_awnd, _cwnd), _rudp._mtu);
//---- Update slow start threshold
if (_ssthresh < CWND)
_ssthresh = Math.Min(64 * 1024, CWND);
}
开发者ID:cheehwasun,项目名称:ourmsg,代码行数:33,代码来源:CongestionWindow.cs
示例5: DisplayTexts
void DisplayTexts(Phase phase)
{
string topTextString = "";
string bottomTextString = "";
switch (phase)
{
case Phase.Memorizes:
topTextString = this.maxMonsterNumber + HIKI;
bottomTextString = MEMORIZES_BOTTOM;
break;
case Phase.Player:
topTextString = ATO + (this.maxMonsterNumber - this.killedMonster) + HIKI;;
bottomTextString = GAME_BOTTOM;
break;
}
this.topText.guiText.text = topTextString;
this.bottomText.guiText.text = bottomTextString;
this.levelText.guiText.enabled = true;
this.topText.guiText.enabled = true;
this.bottomText.guiText.enabled = true;
}
开发者ID:GoldenDrop,项目名称:KIOKUnoSiren_for_WebPlayer,代码行数:25,代码来源:GameMessageWindows.cs
示例6: StateChanged
protected override void StateChanged() {
switch((EntityState)prevState) {
case EntityState.Normal:
bodyCtrl.inputEnabled = false;
ToPhase(Phase.None);
break;
}
base.StateChanged();
switch((EntityState)state) {
case EntityState.Normal:
mNextPhase = Phase.TargetStrike;
bodyCtrl.inputEnabled = true;
ToPhase(Phase.Move);
break;
case EntityState.Dead:
ToPhase(Phase.Dead);
break;
case EntityState.Invalid:
ToPhase(Phase.None);
break;
}
}
开发者ID:PushoN,项目名称:game-off-2013,代码行数:27,代码来源:EnemyBossLightning.cs
示例7: ToStringTest
public void ToStringTest()
{
var complex = new Complex(3.1, 2.5);
var exp = new Phase(new ComplexNumber(complex));
Assert.Equal("phase(3.1+2.5i)", exp.ToString());
}
开发者ID:sys27,项目名称:xFunc,代码行数:7,代码来源:PhaseTest.cs
示例8: ResSetup
static void ResSetup(Status s)
{
if (s == Status.Cancelled)
phase = Phase.Inactive;
else
phase = Phase.Active;
}
开发者ID:juhan,项目名称:NModel,代码行数:7,代码来源:Setup.cs
示例9: ExecuteTest1
public void ExecuteTest1()
{
var complex = new Complex(3.1, 2.5);
var exp = new Phase(new ComplexNumber(complex));
Assert.Equal(complex.Phase, exp.Execute());
}
开发者ID:sys27,项目名称:xFunc,代码行数:7,代码来源:PhaseTest.cs
示例10: delete
public ActionResult delete(int id)
{
PhaseRepository phase_rep = new PhaseRepository();
Phase phase = new Phase();
//GET PHASE
try
{
phase = phase_rep.getPhase(id);
}
catch (Exception exception)
{
//IF THERE IS A MESS UP, RETURN ERROR TO FRONT
TempData["flash"] = "Unable to retrieve phase: " + exception.Message;
return RedirectToAction("Index");
}
//DELETE PHASE
try
{
phase_rep.delete(phase);
TempData["flash"] = "Deleted phase.";
return RedirectToAction("Index");
}
catch (Exception exception)
{
TempData["flash"] = "Unable to delete phase: " + exception.Message;
return RedirectToAction("Index");
}
}
开发者ID:unepwcmc,项目名称:sigtrade,代码行数:30,代码来源:PhasesController.cs
示例11: GetPhases1
public static List<Phase> GetPhases1()
{
List<Phase> results = new List<Phase>();
Phase p = new Phase();
p.Id = REGISTERED;
p.Name = "REGISTERED";
results.Add(p);
p = new Phase();
p.Id = SCANNING;
p.Name = "SCANNING";
results.Add(p);
p = new Phase();
p.Id = MANIPULATION;
p.Name = "MANIPULATION";
results.Add(p);
p = new Phase();
p.Id = PRINTING;
p.Name = "PRINTING";
results.Add(p);
return results;
}
开发者ID:sivarajankumar,项目名称:dentalsmile,代码行数:25,代码来源:Smile.cs
示例12: Update
/// <summary>
/// The update methods follows the flow of:
/// Input (user enters input (swipe,touch))
/// Player character processes input
/// Non-player characters process input
/// </summary>
public void Update()
{
switch (gamePhase)
{
case Phase.INPUT:
{
if(inputManager.TouchListener(out command))
{
gamePhase = Phase.PLAYER;
}
break;
}
case Phase.PLAYER:
{
player.GetComponent<Player>().PhaseBehavior(command);
gamePhase = Phase.ENEMY;
break;
}
case Phase.ENEMY:
{
foreach(GameObject e in enemies)
{
e.GetComponent<Enemy>().PhaseBehavior(command);
}
gamePhase = Phase.INPUT;
break;
}
}
}
开发者ID:seeck,项目名称:TombRaiderGO,代码行数:37,代码来源:GameManager.cs
示例13: SetPhase
private void SetPhase(Phase phase)
{
if (this.phase != phase)
{
this.phase = phase;
switch (phase)
{
case Phase.None:
PlayMusic("");
break;
case Phase.Intro:
PlayMusic("Intro Music");
break;
case Phase.Scene:
PlayMusic("Scene Music");
break;
case Phase.EndingInfiltratorWins:
PlayMusic("Outro Music Good");
break;
case Phase.EndingSectWins:
PlayMusic("Outro Music Evil");
break;
}
}
}
开发者ID:plafone,项目名称:TempleSaboteur,代码行数:25,代码来源:SoundManager.cs
示例14: ChangePhase
public static void ChangePhase(Phase phase)
{
if (instance != null)
{
instance.SetPhase(phase);
}
}
开发者ID:plafone,项目名称:TempleSaboteur,代码行数:7,代码来源:SoundManager.cs
示例15: onStartRide
public override void onStartRide()
{
foreach (motor m in motors)
{
m.GetAxis(this.gameObject);
}
base.onStartRide();
foreach (motor m in motors)
{
m.Enter();
}
if (phases.Count <= 0)
{
animating = false;
return;
}
foreach (motor m in motors)
{
m.Enter();
}
animating = true;
phaseNum = 0;
currentPhase = phases[phaseNum];
currentPhase.running = true;
currentPhase.Enter();
currentPhase.Run();
}
开发者ID:H-POPS,项目名称:SledgeHammer,代码行数:29,代码来源:CustomFlatRide.cs
示例16: Calibrate
static void Calibrate()
{
double data = double.Parse(buffer);
// compute with data (not shown)
phase = Phase.WaitForEvent;
// CalRequested = false;
}
开发者ID:juhan,项目名称:NModel,代码行数:7,代码来源:Reactive.cs
示例17: lowerRoof
public void lowerRoof(){
if( m_Phase == Phase.Wait ) {
m_Tweener.Play(true);
m_Phase = Phase.InMotion;
} else {
Debug.Log("Error! Invalid tween state of the roof");
}
}
开发者ID:Backman,项目名称:Hellbound,代码行数:8,代码来源:Roof.cs
示例18: LoginSocket
public LoginSocket(long s, uint addr, int port)
: base(s, addr, port)
{
phase = Phase.Seed;
PredefinedPacketSizes = new int[] { 4, 62 };
Trace.WriteLine("Login socket created.", "Communication");
}
开发者ID:greeduomacro,项目名称:phoenix,代码行数:8,代码来源:LoginSocket.cs
示例19: startDone
public void startDone(){
if( m_Phase == Phase.InMotion ){
m_Tweener.tweenGroup = 1;
m_Phase = Phase.Wait;
} else {
Debug.Log("Error! Invalid tween state of the roof");
}
}
开发者ID:Backman,项目名称:Hellbound,代码行数:8,代码来源:Roof.cs
示例20: ServoWithinPeriod
/// <summary>
/// Servo smoothly from the joint's present position to a new target position and stay there.
/// Do this in a constant period (i.e. large movements happen more quickly).
/// This is a good way to move a head towards a target of interest.
/// </summary>
/// <param name="target">Target position of joint</param>
/// <param name="period">Time over which the movement should take place</param>
public void ServoWithinPeriod(float target, float period)
{
begin = state; // start from where you are now
end = target; // end at target
attackPeriod = period; // in this many seconds' time
sustainPeriod = float.MaxValue; // stay there indefinitely
phase = Phase.Transition;
}
开发者ID:JamesTryand,项目名称:simergy,代码行数:15,代码来源:Utility.cs
注:本文中的Phase类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论