示例#1
0
        /// <summary>
        /// Determines whether the specified <see cref="DIS.OpenDIS.Enumerations.Environment.ObjectState.AirBurstAndGroundBurst"/> instance is equal to this instance.
        /// </summary>
        /// <param name="other">The <see cref="DIS.OpenDIS.Enumerations.Environment.ObjectState.AirBurstAndGroundBurst"/> instance to compare with this instance.</param>
        /// <returns>
        ///     <c>true</c> if the specified <see cref="DIS.OpenDIS.Enumerations.Environment.ObjectState.AirBurstAndGroundBurst"/> is equal to this instance; otherwise, <c>false</c>.
        /// </returns>
        public bool Equals(AirBurstAndGroundBurst other)
        {
            // If parameter is null return false (cast to object to prevent recursive loop!)
            if ((object)other == null)
            {
                return(false);
            }

            return
                (this.Opacity == other.Opacity &&
                 this.Size == other.Size &&
                 this.Height == other.Height &&
                 this.NumOfBursts == other.NumOfBursts &&
                 this.Chemical == other.Chemical);
        }
示例#2
0
        /// <summary>
        /// Creates the <see cref="DIS.OpenDIS.Enumerations.Environment.ObjectState.AirBurstAndGroundBurst"/> instance from the uint value.
        /// </summary>
        /// <param name="value">The uint value which represents the <see cref="DIS.OpenDIS.Enumerations.Environment.ObjectState.AirBurstAndGroundBurst"/> instance.</param>
        /// <returns>The <see cref="DIS.OpenDIS.Enumerations.Environment.ObjectState.AirBurstAndGroundBurst"/> instance, represented by the uint value.</returns>
        public static AirBurstAndGroundBurst FromUInt32(uint value)
        {
            AirBurstAndGroundBurst ps = new AirBurstAndGroundBurst();

            uint mask0     = 0xff0000;
            byte shift0    = 16;
            uint newValue0 = (value & mask0) >> shift0;

            ps.Opacity = (byte)newValue0;

            uint mask1     = 0xff000000;
            byte shift1    = 24;
            uint newValue1 = (value & mask1) >> shift1;

            ps.Size = (byte)newValue1;

            uint mask2     = 0x00ff;
            byte shift2    = 32;
            uint newValue2 = (value & mask2) >> shift2;

            ps.Height = (byte)newValue2;

            uint mask3     = 0x3f00;
            byte shift3    = 40;
            uint newValue3 = (value & mask3) >> shift3;

            ps.NumOfBursts = (byte)newValue3;

            uint mask4     = 0xc000;
            byte shift4    = 46;
            uint newValue4 = (value & mask4) >> shift4;

            ps.Chemical = (AirBurstAndGroundBurst.ChemicalValue)newValue4;

            return(ps);
        }