示例#1
0
		/// <summary>
		/// Sets a power for a base quantity
		/// </summary>
		/// <param name="baseQuantity">The base quantity</param>
		/// <param name="power">The power</param>
		public void SetPower(DimensionBase baseQuantity,double power)
		{
            switch (baseQuantity)
            {
                case DimensionBase.Length:
                    length = power;
                    break;
                case DimensionBase.Mass:
                    mass = power;
                    break;
                case DimensionBase.Time:
                    time = power;
                    break;
                case DimensionBase.ElectricCurrent:
                    electricCurrent = power;
                    break;
                case DimensionBase.Temperature:
                    temperature = power;
                    break;
                case DimensionBase.AmountOfSubstance:
                    amountOfSubstance = power;
                    break;
                case DimensionBase.LuminousIntensity:
                    luminousIntensity = power;
                    break;
                case DimensionBase.Currency:
                    currency = power;
                    break;
                default:
                    throw new Exception("Unexpected exception");
            }

		}
示例#2
0
		/// <summary>
		/// Returns the power of a base quantity
		/// </summary>
		/// <param name="baseQuantity">The base quantity</param>
		/// <returns>The power</returns>
		public double GetPower(DimensionBase baseQuantity)
		{
            double power;

            switch (baseQuantity)
            {
                case DimensionBase.Length:
                    return length;
                case DimensionBase.Mass:
                    return mass;
                case DimensionBase.Time:
                    return time;
                case DimensionBase.ElectricCurrent:
                    return electricCurrent;
                case DimensionBase.Temperature:
                    return temperature;
                case DimensionBase.AmountOfSubstance:
                    return amountOfSubstance;
                case DimensionBase.LuminousIntensity:
                    return luminousIntensity;
                case DimensionBase.Currency:
                    return currency;
                default:
                    throw new Exception("unexpected exception");
                    break;
            }
		}
示例#3
0
		/// <summary>
		/// Returns the power of a base quantity
		/// </summary>
		/// <param name="baseQuantity">The base quantity</param>
		/// <returns>The power</returns>
		public double GetPower(DimensionBase baseQuantity)
		{
			return _count[(int) baseQuantity];
		}
示例#4
0
		/// <summary>
		/// Sets a power for a base quantity
		/// </summary>
		/// <param name="baseQuantity">The base quantity</param>
		/// <param name="power">The power</param>
		public void SetPower(DimensionBase baseQuantity,double power)
		{
			_count[(int) baseQuantity] = power;
		}
示例#5
0
        /// <summary>
		/// Returns the power of a base quantity
		/// </summary>
		/// <param name="baseQuantity">The base quantity</param>
		/// <returns>The power</returns>
		public double GetPower(DimensionBase baseQuantity)
		{
			return baseDimensionPower[(int) baseQuantity];
		}