Exemple #1
0
        /// <summary>
        /// Creates the <see cref="OpenDis.Enumerations.DistributedEmission.Iff.Type2Parameter4Mode4InterrogatorStatus"/> instance from the ushort value.
        /// </summary>
        /// <param name="value">The ushort value which represents the <see cref="OpenDis.Enumerations.DistributedEmission.Iff.Type2Parameter4Mode4InterrogatorStatus"/> instance.</param>
        /// <returns>The <see cref="OpenDis.Enumerations.DistributedEmission.Iff.Type2Parameter4Mode4InterrogatorStatus"/> instance, represented by the ushort value.</returns>
        public static Type2Parameter4Mode4InterrogatorStatus FromUInt16(ushort value)
        {
            Type2Parameter4Mode4InterrogatorStatus ps = new Type2Parameter4Mode4InterrogatorStatus();

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

            ps.CodeElement1 = (Type2Parameter4Mode4InterrogatorStatus.CodeElement1Value)newValue0;

            uint mask2     = 0x2000;
            byte shift2    = 13;
            uint newValue2 = (value & mask2) >> shift2;

            ps.Status = (Type2Parameter4Mode4InterrogatorStatus.StatusValue)newValue2;

            uint mask3     = 0x4000;
            byte shift3    = 14;
            uint newValue3 = (value & mask3) >> shift3;

            ps.Damage = (Type2Parameter4Mode4InterrogatorStatus.DamageValue)newValue3;

            uint mask4     = 0x8000;
            byte shift4    = 15;
            uint newValue4 = (value & mask4) >> shift4;

            ps.Malfunction = (Type2Parameter4Mode4InterrogatorStatus.MalfunctionValue)newValue4;

            return(ps);
        }
Exemple #2
0
        /// <summary>
        /// Determines whether the specified <see cref="OpenDis.Enumerations.DistributedEmission.Iff.Type2Parameter4Mode4InterrogatorStatus"/> instance is equal to this instance.
        /// </summary>
        /// <param name="other">The <see cref="OpenDis.Enumerations.DistributedEmission.Iff.Type2Parameter4Mode4InterrogatorStatus"/> instance to compare with this instance.</param>
        /// <returns>
        ///     <c>true</c> if the specified <see cref="OpenDis.Enumerations.DistributedEmission.Iff.Type2Parameter4Mode4InterrogatorStatus"/> is equal to this instance; otherwise, <c>false</c>.
        /// </returns>
        public bool Equals(Type2Parameter4Mode4InterrogatorStatus other)
        {
            // If parameter is null return false (cast to object to prevent recursive loop!)
            if ((object)other == null)
            {
                return(false);
            }

            return
                (this.CodeElement1 == other.CodeElement1 &&
                 this.Status == other.Status &&
                 this.Damage == other.Damage &&
                 this.Malfunction == other.Malfunction);
        }
        /// <summary>
        /// Determines whether the specified <see cref="OpenDis.Enumerations.DistributedEmission.Iff.Type2Parameter4Mode4InterrogatorStatus"/> instance is equal to this instance.
        /// </summary>
        /// <param name="other">The <see cref="OpenDis.Enumerations.DistributedEmission.Iff.Type2Parameter4Mode4InterrogatorStatus"/> instance to compare with this instance.</param>
        /// <returns>
        /// 	<c>true</c> if the specified <see cref="OpenDis.Enumerations.DistributedEmission.Iff.Type2Parameter4Mode4InterrogatorStatus"/> is equal to this instance; otherwise, <c>false</c>.
        /// </returns>
        public bool Equals(Type2Parameter4Mode4InterrogatorStatus other)
        {
            // If parameter is null return false (cast to object to prevent recursive loop!)
            if ((object)other == null)
            {
                return false;
            }

            return
                this.CodeElement1 == other.CodeElement1 &&
                this.Status == other.Status &&
                this.Damage == other.Damage &&
                this.Malfunction == other.Malfunction;
        }
        /// <summary>
        /// Creates the <see cref="OpenDis.Enumerations.DistributedEmission.Iff.Type2Parameter4Mode4InterrogatorStatus"/> instance from the ushort value.
        /// </summary>
        /// <param name="value">The ushort value which represents the <see cref="OpenDis.Enumerations.DistributedEmission.Iff.Type2Parameter4Mode4InterrogatorStatus"/> instance.</param>
        /// <returns>The <see cref="OpenDis.Enumerations.DistributedEmission.Iff.Type2Parameter4Mode4InterrogatorStatus"/> instance, represented by the ushort value.</returns>
        public static Type2Parameter4Mode4InterrogatorStatus FromUInt16(ushort value)
        {
            Type2Parameter4Mode4InterrogatorStatus ps = new Type2Parameter4Mode4InterrogatorStatus();

            uint mask0 = 0x0fff;
            byte shift0 = 0;
            uint newValue0 = value & mask0 >> shift0;
            ps.CodeElement1 = (Type2Parameter4Mode4InterrogatorStatus.CodeElement1Value)newValue0;

            uint mask2 = 0x2000;
            byte shift2 = 13;
            uint newValue2 = value & mask2 >> shift2;
            ps.Status = (Type2Parameter4Mode4InterrogatorStatus.StatusValue)newValue2;

            uint mask3 = 0x4000;
            byte shift3 = 14;
            uint newValue3 = value & mask3 >> shift3;
            ps.Damage = (Type2Parameter4Mode4InterrogatorStatus.DamageValue)newValue3;

            uint mask4 = 0x8000;
            byte shift4 = 15;
            uint newValue4 = value & mask4 >> shift4;
            ps.Malfunction = (Type2Parameter4Mode4InterrogatorStatus.MalfunctionValue)newValue4;

            return ps;
        }