本文整理汇总了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();
}
}
}
示例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;
}
示例3: TestConstructorValueCultureException
public void TestConstructorValueCultureException()
{
Speed speed = new Speed("5", CultureInfo.CurrentCulture);
Assert.AreEqual(5, speed.Value);
Assert.AreEqual(SpeedUnit.MetersPerSecond, speed.Units);
}
示例4: Fan
public Fan(Cpu.PWMChannel pin)
{
this.pwmChannel = pin;
this.speed = Speed.None;
this.frequency = (double)100;
Start();
}
示例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;
}
示例6: Settings
public Settings()
{
this.allowedShapes = Shapes.All;
this.customSpeed = 0;
this.drawSpeed = Speed.Normal;
this.useTransparency = true;
}
示例7: Decoded
public Decoded(GeoPosition currentLocation, DateTime currentTime, Heading currentHeading, Speed currentSpeed)
{
CurrentLocation = currentLocation;
CurrentTime = currentTime;
CurrentHeading = currentHeading;
CurrentSpeed = currentSpeed;
}
示例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);
}
示例9: TestConstructorValue
public void TestConstructorValue()
{
Speed speed = new Speed("5 m/s");
Assert.AreEqual(5, speed.Value);
Assert.AreEqual(SpeedUnit.MetersPerSecond, speed.Units);
}
示例10: ConvertToMeterAtSecond
public MeterAtSecond ConvertToMeterAtSecond(Speed speed)
{
if(speed is MeterAtSecond)
{
return new MeterAtSecond(speed.value);
}
return new MeterAtSecond((speed.value * 1000) / 3600);
}
示例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>();
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}