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


C# Speed类代码示例

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


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

示例1: ConvertToSi

        public void ConvertToSi(Speed v, string dimension)
        {
            if (dimension != "m/s" )
            {
                if (dimension == "km/h")
                {
                    v.Value *= 0.277778;
                }
                if (dimension == "mph")
                {
                    v.Value *= 0.44704;
                }
                if (dimension == "knot")
                {
                    v.Value *= 0.514444;
                }
                if (dimension == "ft/s")
                {
                    v.Value *= 0.3048;
                }

                else
                {
                    throw new IncorrectDimensionOfSpeedException();
                }
            }
        }
开发者ID:alena-butkevich,项目名称:OOP,代码行数:27,代码来源:ConverterForSpeed.cs

示例2: Hover

 public Hover(Speed p_xMove, Speed p_yMove, int p_duration, bool p_relativeToPlayer)
 {
     this.relativeToPlayer = p_relativeToPlayer;
     this.duration = p_duration;
     this.yMove = p_yMove;
     this.xMove = p_xMove;
 }
开发者ID:maestun,项目名称:wonderboy,代码行数:7,代码来源:Hover.cs

示例3: TestConstructorValueCultureException

        public void TestConstructorValueCultureException()
        {
            Speed speed = new Speed("5", CultureInfo.CurrentCulture);

            Assert.AreEqual(5, speed.Value);
            Assert.AreEqual(SpeedUnit.MetersPerSecond, speed.Units);
        }
开发者ID:Bobfrat,项目名称:RTI,代码行数:7,代码来源:SpeedTest.cs

示例4: Fan

 public Fan(Cpu.PWMChannel pin)
 {
     this.pwmChannel = pin;
     this.speed = Speed.None;
     this.frequency = (double)100;
     Start();
 }
开发者ID:kevjett,项目名称:GrillMaster,代码行数:7,代码来源:Fan.cs

示例5: Datum

 public Datum(DateTime time, Latitude latitude, Longitude longitude, Length altitude = null, Speed speed = null, Heading heading = null)
 {
     _time = time;
     _location = new GeoPosition(latitude, longitude, altitude);
     _speed = speed;
     _heading = heading;
 }
开发者ID:EddieGarmon,项目名称:GraduatedCylinder,代码行数:7,代码来源:GeoTrail.cs

示例6: Settings

 public Settings()
 {
     this.allowedShapes = Shapes.All;
     this.customSpeed = 0;
     this.drawSpeed = Speed.Normal;
     this.useTransparency = true;
 }
开发者ID:jptoto,项目名称:savestagram,代码行数:7,代码来源:Settings.cs

示例7: Decoded

 public Decoded(GeoPosition currentLocation, DateTime currentTime, Heading currentHeading, Speed currentSpeed)
 {
     CurrentLocation = currentLocation;
     CurrentTime = currentTime;
     CurrentHeading = currentHeading;
     CurrentSpeed = currentSpeed;
 }
开发者ID:EddieGarmon,项目名称:GraduatedCylinder,代码行数:7,代码来源:GPRMC_Sentence.cs

示例8: VerifyAllEnums

 public void VerifyAllEnums()
 {
     var acceleration = new Acceleration(1, AccelerationUnit.BaseUnit);
     var angle = new Angle(1, AngleUnit.BaseUnit);
     var angularAcceleration = new AngularAcceleration(1, AngularAccelerationUnit.BaseUnit);
     var area = new Area(1, AreaUnit.BaseUnit);
     var density = new MassDensity(1, MassDensityUnit.BaseUnit);
     var electricCurrent = new ElectricCurrent(1, ElectricCurrentUnit.BaseUnit);
     var electricResistance = new ElectricResistance(1, ElectricResistanceUnit.BaseUnit);
     var electricVoltage = new ElectricPotential(1, ElectricPotentialUnit.BaseUnit);
     var energy = new Energy(1, EnergyUnit.BaseUnit);
     var force = new Force(1, ForceUnit.BaseUnit);
     var frequency = new Frequency(1, FrequencyUnit.BaseUnit);
     var jerk = new Jerk(1, JerkUnit.BaseUnit);
     var length = new Length(1, LengthUnit.BaseUnit);
     var mass = new Mass(1, MassUnit.BaseUnit);
     var massFlowRate = new MassFlowRate(1, MassFlowRateUnit.BaseUnit);
     var momentum = new Momentum(1, MomentumUnit.BaseUnit);
     var numeric = new Numeric(1, NumericUnit.BaseUnit);
     var power = new Power(1, PowerUnit.BaseUnit);
     var pressure = new Pressure(1, PressureUnit.BaseUnit);
     var speed = new Speed(1, SpeedUnit.BaseUnit);
     var temperature = new Temperature(1, TemperatureUnit.BaseUnit);
     var time = new Time(1, TimeUnit.BaseUnit);
     var torque = new Torque(1, TorqueUnit.BaseUnit);
     var volume = new Volume(1, VolumeUnit.BaseUnit);
     var volumetricFlowRate = new VolumetricFlowRate(1, VolumetricFlowRateUnit.BaseUnit);
 }
开发者ID:EddieGarmon,项目名称:GraduatedCylinder,代码行数:28,代码来源:EnumerationVerification.cs

示例9: TestConstructorValue

        public void TestConstructorValue()
        {
            Speed speed = new Speed("5 m/s");

            Assert.AreEqual(5, speed.Value);
            Assert.AreEqual(SpeedUnit.MetersPerSecond, speed.Units);
        }
开发者ID:Bobfrat,项目名称:RTI,代码行数:7,代码来源:SpeedTest.cs

示例10: ConvertToMeterAtSecond

 public MeterAtSecond ConvertToMeterAtSecond(Speed speed)
 {
     if(speed is MeterAtSecond)
     {
         return new MeterAtSecond(speed.value);
     }
     return new MeterAtSecond((speed.value * 1000) / 3600);
 }
开发者ID:KseniyaTarantsei,项目名称:Physics,代码行数:8,代码来源:MyConverter.cs

示例11: Start

 // Use this for initialization
 void Start()
 {
     speedEnum = Speed.faster;
     startSpeed = speed;
     startVector = transform.position;
     player = GameObject.FindGameObjectWithTag("Player").GetComponent<Player>();
     moveCamera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<MoveCamera>();
 }
开发者ID:TheAwesomeProgrammer,项目名称:WizardPlatfromGame,代码行数:9,代码来源:MoveCamera.cs

示例12: OpAddition

 public void OpAddition()
 {
     var speed1 = new Speed(3600, SpeedUnit.MetersPerHour);
     var speed2 = new Speed(1, SpeedUnit.MetersPerMinute);
     var expected = new Speed(3660, SpeedUnit.MetersPerHour);
     (speed1 + speed2).ShouldEqual(expected);
     (speed2 + speed1).ShouldEqual(expected);
 }
开发者ID:EddieGarmon,项目名称:GraduatedCylinder,代码行数:8,代码来源:SpeedOperators.cs

示例13: Data

 public Data(Position2 p, Velocity2 v, Unit z, Speed vz, bool collideWithProjectileColliders)
 {
     this.position = p;
     this.velocity = v;
     this.z = z;
     this.vz = vz;
     this.collideWithProjectileColliders = collideWithProjectileColliders;
 }
开发者ID:amulware,项目名称:ld33,代码行数:8,代码来源:CollidingParticle.cs

示例14: CollidingParticle

 public CollidingParticle(GameState game,
     Position2 position, Velocity2 velocity,
     Unit z, Speed vz,
     bool collideWithProjectileColliders)
     : base(game)
 {
     this.data = new Data(position, velocity, z, vz, collideWithProjectileColliders);
 }
开发者ID:amulware,项目名称:ld33,代码行数:8,代码来源:CollidingParticle.cs

示例15: ShipMoveOrder

 /// <summary>
 /// Initializes a new instance of the <see cref="ShipMoveOrder" /> class.
 /// </summary>
 /// <param name="source">The source of the order.</param>
 /// <param name="target">The move target.</param>
 /// <param name="speed">The move speed.</param>
 /// <param name="isFleetwide">if set to <c>true</c> the move should be coordinated as a fleet.</param>
 /// <param name="targetStandoffDistance">When the ship arrives at the target, this is the distance
 /// from the target it should strive to achieve.</param>
 public ShipMoveOrder(OrderSource source, IShipNavigable target, Speed speed, bool isFleetwide, float targetStandoffDistance)
     : base(ShipDirective.Move, source, false, target) {
     Utility.ValidateNotNull(target);
     D.AssertNotDefault((int)speed);
     Utility.ValidateNotNegative(targetStandoffDistance);
     Speed = speed;
     IsFleetwide = isFleetwide;
     TargetStandoffDistance = targetStandoffDistance;
 }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:18,代码来源:ShipMoveOrder.cs


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