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


C# VariableState类代码示例

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


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

示例1: SetState

		void SetState (string identifier, VariableState state)
		{
			var variable = usedVariables.FirstOrDefault (v => v.Name == identifier);
			if (variable == null)
				return;
			VariableState oldState;
			if (states.TryGetValue (variable, out oldState)) {
				if (oldState < state)
					states [variable] = state;
			} else {
				states [variable] = state;
			}
		}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:13,代码来源:VariableUsageAnalyzation.cs

示例2: BreakIntoPieces

        private void BreakIntoPieces(VariableState newRockState)
        {
            for (int i = 0; i < NumberOfRocksToBreakInto; i++)
            {
                Rock newRock = RockBlaster.Factories.RockFactory.CreateNew();
                newRock.Position = this.Position;
                newRock.Position.X += -1 + 2 * (float)(FlatRedBallServices.Random.NextDouble());
                newRock.Position.Y += -1 + 2 * (float)(FlatRedBallServices.Random.NextDouble());

                float randomAngle =
                    (float)(FlatRedBallServices.Random.NextDouble() * System.Math.PI * 2);

                float speed = 0 + (float)(FlatRedBallServices.Random.NextDouble() * RandomSpeedOnBreak);
                newRock.Velocity = FlatRedBall.Math.MathFunctions.AngleToVector(randomAngle) * speed;
                newRock.CurrentState = newRockState;
            }
        }
开发者ID:Paulsane,项目名称:RockBlaster,代码行数:17,代码来源:Rock.cs

示例3: GetVariableState

        private VariableState GetVariableState(Operand operand)
        {
            VariableState variable;

            if (!variableStates.TryGetValue(operand, out variable))
            {
                variable = new VariableState(operand);
                variableStates.Add(operand, variable);
            }

            return variable;
        }
开发者ID:pacificIT,项目名称:MOSA-Project,代码行数:12,代码来源:SparseConditionalConstantPropagation.cs

示例4: InterpolateBetween

 public void InterpolateBetween(VariableState firstState, VariableState secondState, float interpolationValue)
 {
     #if DEBUG
     if (float.IsNaN(interpolationValue))
     {
         throw new Exception("interpolationValue cannot be NaN");
     }
     #endif
     bool setOverallAlpha = true;
     float OverallAlphaFirstValue= 0;
     float OverallAlphaSecondValue= 0;
     switch(firstState)
     {
         case  VariableState.Activated:
             OverallAlphaFirstValue = 1f;
             break;
         case  VariableState.Deactivated:
             OverallAlphaFirstValue = 0f;
             break;
     }
     switch(secondState)
     {
         case  VariableState.Activated:
             OverallAlphaSecondValue = 1f;
             break;
         case  VariableState.Deactivated:
             OverallAlphaSecondValue = 0f;
             break;
     }
     if (setOverallAlpha)
     {
         OverallAlpha = OverallAlphaFirstValue * (1 - interpolationValue) + OverallAlphaSecondValue * interpolationValue;
     }
     if (interpolationValue < 1)
     {
         mCurrentState = (int)firstState;
     }
     else
     {
         mCurrentState = (int)secondState;
     }
 }
开发者ID:KallDrexx,项目名称:FRB-UiTestBed,代码行数:42,代码来源:MainMenu.Generated.cs

示例5: AddInstruction

 private void AddInstruction(VariableState variable)
 {
     foreach (var use in variable.Operand.Uses)
     {
         if (executedStatements.Contains(use))
         {
             AddInstruction(use);
         }
     }
 }
开发者ID:pacificIT,项目名称:MOSA-Project,代码行数:10,代码来源:SparseConditionalConstantPropagation.cs

示例6: StopStateInterpolation

		public void StopStateInterpolation (VariableState stateToStop)
		{
			switch(stateToStop)
			{
				case  VariableState.Opaque:
					SpriteObject.AlphaRate =  0;
					break;
				case  VariableState.Transparent:
					SpriteObject.AlphaRate =  0;
					break;
			}
			CurrentState = stateToStop;
		}
开发者ID:JdGXII,项目名称:EconoFight,代码行数:13,代码来源:SplashScreen.Generated.cs

示例7: StopStateInterpolation

 public void StopStateInterpolation(VariableState stateToStop)
 {
     switch(stateToStop)
     {
         case  VariableState.Activated:
             OverallAlphaVelocity =  0;
             break;
         case  VariableState.Deactivated:
             OverallAlphaVelocity =  0;
             break;
     }
     CurrentState = stateToStop;
 }
开发者ID:KallDrexx,项目名称:FRB-UiTestBed,代码行数:13,代码来源:MainMenu.Generated.cs

示例8: UpdateToOverDefined

        private void UpdateToOverDefined(VariableState variable)
        {
            if (variable.IsOverDefined)
                return;

            variable.IsOverDefined = true;

            if (MainTrace.Active) MainTrace.Log(variable.ToString());

            AddInstruction(variable);
        }
开发者ID:pacificIT,项目名称:MOSA-Project,代码行数:11,代码来源:SparseConditionalConstantPropagation.cs

示例9: PushState

        /// <summary>Sets the current state, and pushes that state onto the back stack.</summary>
        public void PushState(VariableState state)
        {
            this.CurrentState = state;

            #if !MONOGAME
            ScreenManager.PushStateToStack((int)this.CurrentState);
            #endif
        }
开发者ID:zunath,项目名称:WinterEngine,代码行数:9,代码来源:SplashScreen.Generated.cs

示例10: StopStateInterpolation

 public void StopStateInterpolation(VariableState stateToStop)
 {
     switch(stateToStop)
     {
         case  VariableState.R_Idle:
             break;
         case  VariableState.L_Idle:
             break;
         case  VariableState.R_Hurt:
             break;
         case  VariableState.L_Hurt:
             break;
         case  VariableState.R_Die:
             break;
         case  VariableState.L_Die:
             break;
         case  VariableState.R_Attack:
             break;
         case  VariableState.L_Attack:
             break;
         case  VariableState.R_Walking:
             break;
         case  VariableState.L_Walking:
             break;
     }
     CurrentState = stateToStop;
 }
开发者ID:Zephyr6,项目名称:Stack-Tracer,代码行数:27,代码来源:Enemy.Generated.cs

示例11: StopStateInterpolation

		public void StopStateInterpolation (VariableState stateToStop)
		{
			switch(stateToStop)
			{
				case  VariableState.Hayek:
					break;
				case  VariableState.Keynes:
					break;
				case  VariableState.Malthus:
					break;
				case  VariableState.Smith:
					break;
			}
			CurrentState = stateToStop;
		}
开发者ID:JdGXII,项目名称:EconoFight,代码行数:15,代码来源:SuperAtaque.Generated.cs

示例12: InterpolateBetween

 public void InterpolateBetween(VariableState firstState, VariableState secondState, float interpolationValue)
 {
     #if DEBUG
     if (float.IsNaN(interpolationValue))
     {
         throw new Exception("interpolationValue cannot be NaN");
     }
     #endif
     switch(firstState)
     {
         case  VariableState.R_Idle:
             break;
         case  VariableState.L_Idle:
             break;
         case  VariableState.R_Hurt:
             break;
         case  VariableState.L_Hurt:
             break;
         case  VariableState.R_Die:
             break;
         case  VariableState.L_Die:
             break;
         case  VariableState.R_Attack:
             break;
         case  VariableState.L_Attack:
             break;
         case  VariableState.R_Walking:
             break;
         case  VariableState.L_Walking:
             break;
     }
     switch(secondState)
     {
         case  VariableState.R_Idle:
             break;
         case  VariableState.L_Idle:
             break;
         case  VariableState.R_Hurt:
             break;
         case  VariableState.L_Hurt:
             break;
         case  VariableState.R_Die:
             break;
         case  VariableState.L_Die:
             break;
         case  VariableState.R_Attack:
             break;
         case  VariableState.L_Attack:
             break;
         case  VariableState.R_Walking:
             break;
         case  VariableState.L_Walking:
             break;
     }
 }
开发者ID:Zephyr6,项目名称:Stack-Tracer,代码行数:55,代码来源:Enemy.Generated.cs

示例13: InterpolateToState

 public Instruction InterpolateToState(VariableState stateToInterpolateTo, double secondsToTake)
 {
     switch(stateToInterpolateTo)
     {
         case  VariableState.R_Idle:
             break;
         case  VariableState.L_Idle:
             break;
         case  VariableState.R_Hurt:
             break;
         case  VariableState.L_Hurt:
             break;
         case  VariableState.R_Die:
             break;
         case  VariableState.L_Die:
             break;
         case  VariableState.R_Attack:
             break;
         case  VariableState.L_Attack:
             break;
         case  VariableState.R_Walking:
             break;
         case  VariableState.L_Walking:
             break;
     }
     var instruction = new DelegateInstruction<VariableState>(StopStateInterpolation, stateToInterpolateTo);
     instruction.TimeToExecute = TimeManager.CurrentTime + secondsToTake;
     this.Instructions.Add(instruction);
     return instruction;
 }
开发者ID:Zephyr6,项目名称:Stack-Tracer,代码行数:30,代码来源:Enemy.Generated.cs

示例14: StopStateInterpolation

 public void StopStateInterpolation(VariableState stateToStop)
 {
     switch(stateToStop)
     {
         case VariableState.Regular:
             break;
         case VariableState.Pressed:
             break;
         case VariableState.Disabled:
             break;
         case VariableState.Hover:
             break;
     }
     CurrentState = stateToStop;
 }
开发者ID:Zephyr6,项目名称:StackTracer2,代码行数:15,代码来源:Button.Generated.cs

示例15: InterpolateToState

 public Instruction InterpolateToState(VariableState stateToInterpolateTo, double secondsToTake)
 {
     switch(stateToInterpolateTo)
     {
         case VariableState.Regular:
             break;
         case VariableState.Pressed:
             break;
         case VariableState.Disabled:
             break;
         case VariableState.Hover:
             break;
     }
     var instruction = new DelegateInstruction<VariableState>(StopStateInterpolation, stateToInterpolateTo);
     instruction.TimeToExecute = TimeManager.CurrentTime + secondsToTake;
     this.Instructions.Add(instruction);
     return instruction;
 }
开发者ID:Zephyr6,项目名称:StackTracer2,代码行数:18,代码来源:Button.Generated.cs


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