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

            return
                (this.Configuration == other.Configuration &&
                 this.HullMountedMasker == other.HullMountedMasker);
        }
コード例 #2
0
        /// <summary>
        /// Creates the <see cref="OpenDis.Enumerations.DistributedEmission.UnderwaterAcoustic.PropulsionPlantConfiguration"/> instance from the uint value.
        /// </summary>
        /// <param name="value">The uint value which represents the <see cref="OpenDis.Enumerations.DistributedEmission.UnderwaterAcoustic.PropulsionPlantConfiguration"/> instance.</param>
        /// <returns>The <see cref="OpenDis.Enumerations.DistributedEmission.UnderwaterAcoustic.PropulsionPlantConfiguration"/> instance, represented by the uint value.</returns>
        public static PropulsionPlantConfiguration FromUInt32(uint value)
        {
            PropulsionPlantConfiguration ps = new PropulsionPlantConfiguration();

            uint mask0     = 0x007f;
            byte shift0    = 0;
            uint newValue0 = value & mask0 >> shift0;

            ps.Configuration = (PropulsionPlantConfiguration.ConfigurationValue)newValue0;

            uint mask1     = 0x0080;
            byte shift1    = 7;
            uint newValue1 = value & mask1 >> shift1;

            ps.HullMountedMasker = (PropulsionPlantConfiguration.HullMountedMaskerValue)newValue1;

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

            return
                this.Configuration == other.Configuration &&
                this.HullMountedMasker == other.HullMountedMasker;
        }
コード例 #4
0
        /// <summary>
        /// Creates the <see cref="OpenDis.Enumerations.DistributedEmission.UnderwaterAcoustic.PropulsionPlantConfiguration"/> instance from the uint value.
        /// </summary>
        /// <param name="value">The uint value which represents the <see cref="OpenDis.Enumerations.DistributedEmission.UnderwaterAcoustic.PropulsionPlantConfiguration"/> instance.</param>
        /// <returns>The <see cref="OpenDis.Enumerations.DistributedEmission.UnderwaterAcoustic.PropulsionPlantConfiguration"/> instance, represented by the uint value.</returns>
        public static PropulsionPlantConfiguration FromUInt32(uint value)
        {
            PropulsionPlantConfiguration ps = new PropulsionPlantConfiguration();

            uint mask0 = 0x007f;
            byte shift0 = 0;
            uint newValue0 = value & mask0 >> shift0;
            ps.Configuration = (PropulsionPlantConfiguration.ConfigurationValue)newValue0;

            uint mask1 = 0x0080;
            byte shift1 = 7;
            uint newValue1 = value & mask1 >> shift1;
            ps.HullMountedMasker = (PropulsionPlantConfiguration.HullMountedMaskerValue)newValue1;

            return ps;
        }