/// <summary> /// Determines whether the specified <see cref="OpenDis.Enumerations.DistributedEmission.Iff.Type1Parameter5ModeCCodeStatus"/> instance is equal to this instance. /// </summary> /// <param name="other">The <see cref="OpenDis.Enumerations.DistributedEmission.Iff.Type1Parameter5ModeCCodeStatus"/> instance to compare with this instance.</param> /// <returns> /// <c>true</c> if the specified <see cref="OpenDis.Enumerations.DistributedEmission.Iff.Type1Parameter5ModeCCodeStatus"/> is equal to this instance; otherwise, <c>false</c>. /// </returns> public bool Equals(Type1Parameter5ModeCCodeStatus other) { // If parameter is null return false (cast to object to prevent recursive loop!) if ((object)other == null) { return(false); } return (this.NegativeAltitude == other.NegativeAltitude && this.ModeCAltitude == other.ModeCAltitude && this.Status == other.Status && this.Damage == other.Damage && this.Malfunction == other.Malfunction); }
/// <summary> /// Creates the <see cref="OpenDis.Enumerations.DistributedEmission.Iff.Type1Parameter5ModeCCodeStatus"/> instance from the ushort value. /// </summary> /// <param name="value">The ushort value which represents the <see cref="OpenDis.Enumerations.DistributedEmission.Iff.Type1Parameter5ModeCCodeStatus"/> instance.</param> /// <returns>The <see cref="OpenDis.Enumerations.DistributedEmission.Iff.Type1Parameter5ModeCCodeStatus"/> instance, represented by the ushort value.</returns> public static Type1Parameter5ModeCCodeStatus FromUInt16(ushort value) { Type1Parameter5ModeCCodeStatus ps = new Type1Parameter5ModeCCodeStatus(); uint mask0 = 0x0001; byte shift0 = 0; uint newValue0 = (value & mask0) >> shift0; ps.NegativeAltitude = (Type1Parameter5ModeCCodeStatus.NegativeAltitudeValue)newValue0; uint mask1 = 0x0ffe; byte shift1 = 1; uint newValue1 = (value & mask1) >> shift1; ps.ModeCAltitude = (Type1Parameter5ModeCCodeStatus.ModeCAltitudeValue)newValue1; uint mask3 = 0x2000; byte shift3 = 13; uint newValue3 = (value & mask3) >> shift3; ps.Status = (Type1Parameter5ModeCCodeStatus.StatusValue)newValue3; uint mask4 = 0x4000; byte shift4 = 14; uint newValue4 = (value & mask4) >> shift4; ps.Damage = (Type1Parameter5ModeCCodeStatus.DamageValue)newValue4; uint mask5 = 0x8000; byte shift5 = 15; uint newValue5 = (value & mask5) >> shift5; ps.Malfunction = (Type1Parameter5ModeCCodeStatus.MalfunctionValue)newValue5; return(ps); }
/// <summary> /// Determines whether the specified <see cref="OpenDis.Enumerations.DistributedEmission.Iff.Type1Parameter5ModeCCodeStatus"/> instance is equal to this instance. /// </summary> /// <param name="other">The <see cref="OpenDis.Enumerations.DistributedEmission.Iff.Type1Parameter5ModeCCodeStatus"/> instance to compare with this instance.</param> /// <returns> /// <c>true</c> if the specified <see cref="OpenDis.Enumerations.DistributedEmission.Iff.Type1Parameter5ModeCCodeStatus"/> is equal to this instance; otherwise, <c>false</c>. /// </returns> public bool Equals(Type1Parameter5ModeCCodeStatus other) { // If parameter is null return false (cast to object to prevent recursive loop!) if ((object)other == null) { return false; } return this.NegativeAltitude == other.NegativeAltitude && this.ModeCAltitude == other.ModeCAltitude && this.Status == other.Status && this.Damage == other.Damage && this.Malfunction == other.Malfunction; }
/// <summary> /// Creates the <see cref="OpenDis.Enumerations.DistributedEmission.Iff.Type1Parameter5ModeCCodeStatus"/> instance from the ushort value. /// </summary> /// <param name="value">The ushort value which represents the <see cref="OpenDis.Enumerations.DistributedEmission.Iff.Type1Parameter5ModeCCodeStatus"/> instance.</param> /// <returns>The <see cref="OpenDis.Enumerations.DistributedEmission.Iff.Type1Parameter5ModeCCodeStatus"/> instance, represented by the ushort value.</returns> public static Type1Parameter5ModeCCodeStatus FromUInt16(ushort value) { Type1Parameter5ModeCCodeStatus ps = new Type1Parameter5ModeCCodeStatus(); uint mask0 = 0x0001; byte shift0 = 0; uint newValue0 = value & mask0 >> shift0; ps.NegativeAltitude = (Type1Parameter5ModeCCodeStatus.NegativeAltitudeValue)newValue0; uint mask1 = 0x0ffe; byte shift1 = 1; uint newValue1 = value & mask1 >> shift1; ps.ModeCAltitude = (Type1Parameter5ModeCCodeStatus.ModeCAltitudeValue)newValue1; uint mask3 = 0x2000; byte shift3 = 13; uint newValue3 = value & mask3 >> shift3; ps.Status = (Type1Parameter5ModeCCodeStatus.StatusValue)newValue3; uint mask4 = 0x4000; byte shift4 = 14; uint newValue4 = value & mask4 >> shift4; ps.Damage = (Type1Parameter5ModeCCodeStatus.DamageValue)newValue4; uint mask5 = 0x8000; byte shift5 = 15; uint newValue5 = value & mask5 >> shift5; ps.Malfunction = (Type1Parameter5ModeCCodeStatus.MalfunctionValue)newValue5; return ps; }