Esempio n. 1
0
        /// <summary>
        /// Missile passive sensor constructor. This is actually not a component.
        /// </summary>
        /// <param name="PassiveStrength">Missile Passive Strength</param>
        /// <param name="TorE">Thermal or EM?</param>
        public PassiveSensorDefTN(float PassiveStrength, PassiveSensorType TOrE)
        {
            Id            = Guid.NewGuid();
            componentType = ComponentTypeTN.TypeCount;

            Name        = "MissilePassive";
            Sensitivity = 0;
            Hardening   = 0;

            ThermalOrEM = TOrE;

            LookUpTableMax = 10000;

            /// <summary>
            /// Rating is the best way to compare sensors against each other.
            /// while Range tells me at what distance a signature of 1000 will be detected in KM.
            /// </summary>
            Rating = PassiveStrength;
            Range  = (int)(Rating * 100.0f);

            /// <summary>
            /// Populate the lookup table.
            /// </summary>
            LookUpTable = new BindingList <int>();
            for (ushort loop = 0; loop < LookUpTableMax; loop++)
            {
                int DetectionRange = CalcUnknownSignature(loop);
                LookUpTable.Add(DetectionRange);
            }

            crew         = 0;
            cost         = 0;
            htk          = 0;
            size         = 0;
            isMilitary   = false;
            isObsolete   = false;
            isSalvaged   = false;
            isDivisible  = false;
            isElectronic = false;
        }
Esempio n. 2
0
        /// <summary>
        /// Given the input that aurora expects, this constructor will build an appropriate passive sensor.
        /// </summary>
        /// <param name="title">Name of the sensor.</param>
        /// <param name="HS">Size of the sensor in HS. 0.1 to 50</param>
        /// <param name="sens">Sensitivity per HS of the sensor.</param>
        /// <param name="TOrE">Thermal/EM identifier for this sensor. false = thermal, true = EM</param>
        /// <param name="hard">Chance of destruction from electronic damage. 1.0 to 0.1</param>
        /// <param name="hardTech">Tech level of sensor hardening. This is to be adjusted downward by one, so level 0 is level 1.</param>
        public PassiveSensorDefTN(string title, float HS, byte sens, PassiveSensorType TOrE, float hard, byte hardTech)
        {
            Id = Guid.NewGuid();
            componentType = ComponentTypeTN.PassiveSensor;

            Name = title;
            size = HS;
            Sensitivity = sens;
            ThermalOrEM = TOrE;
            Hardening = hard;

            LookUpTableMax = 10000;

            /// <summary>
            /// Rating is the best way to compare sensors against each other.
            /// while Range tells me at what distance a signature of 1000 will be detected in KM.
            /// </summary>
            Rating = size * (float)Sensitivity;
            Range = (int)(Rating * 100.0f);

            /// <summary>
            /// Populate the lookup table.
            /// </summary>
            LookUpTable = new BindingList<int>();
            for (ushort loop = 0; loop < LookUpTableMax; loop++)
            {
                int DetectionRange = CalcUnknownSignature(loop);
                LookUpTable.Add(DetectionRange);
            }

            ///<summary>
            ///HTK is either 1 or 0, because all sensors are very weak to damage, especially electronic damage.
            ///</summary>
            if (size >= 1.0)
                htk = 1;
            else
                htk = 0;

            /// <summary>
            /// Crew and cost are related to size, sensitivity, and hardening.
            /// </summary>
            crew = (byte)(size * 2.0);
            cost = (decimal)((size * (float)Sensitivity) + ((size * (float)Sensitivity) * 0.25f * (float)(hardTech - 1)));

            minerialsCost = new decimal[Constants.Minerals.NO_OF_MINERIALS];
            for (int mineralIterator = 0; mineralIterator < (int)Constants.Minerals.MinerialNames.MinerialCount; mineralIterator++)
            {
                minerialsCost[mineralIterator] = 0;
            }
            minerialsCost[(int)Constants.Minerals.MinerialNames.Uridium] = cost;

            if (size <= 1.0)
                isMilitary = false;
            else
                isMilitary = true;

            isObsolete = false;
            isSalvaged = false;
            isDivisible = false;

            isElectronic = true;
        }
Esempio n. 3
0
        /// <summary>
        /// Missile passive sensor constructor. This is actually not a component.
        /// </summary>
        /// <param name="PassiveStrength">Missile Passive Strength</param>
        /// <param name="TorE">Thermal or EM?</param>
        public PassiveSensorDefTN(float PassiveStrength, PassiveSensorType TOrE)
        {
            Id = Guid.NewGuid();
            componentType = ComponentTypeTN.TypeCount;

            Name = "MissilePassive";
            Sensitivity = 0;
            Hardening = 0;

            ThermalOrEM = TOrE;

            LookUpTableMax = 10000;

            /// <summary>
            /// Rating is the best way to compare sensors against each other.
            /// while Range tells me at what distance a signature of 1000 will be detected in KM.
            /// </summary>
            Rating = PassiveStrength;
            Range = (int)(Rating * 100.0f);

            /// <summary>
            /// Populate the lookup table.
            /// </summary>
            LookUpTable = new BindingList<int>();
            for (ushort loop = 0; loop < LookUpTableMax; loop++)
            {
                int DetectionRange = CalcUnknownSignature(loop);
                LookUpTable.Add(DetectionRange);
            }

            crew = 0;
            cost = 0;
            htk = 0;
            size = 0;
            isMilitary = false;
            isObsolete = false;
            isSalvaged = false;
            isDivisible = false;
            isElectronic = false;
        }
Esempio n. 4
0
        /// <summary>
        /// Given the input that aurora expects, this constructor will build an appropriate passive sensor.
        /// </summary>
        /// <param name="title">Name of the sensor.</param>
        /// <param name="HS">Size of the sensor in HS. 0.1 to 50</param>
        /// <param name="sens">Sensitivity per HS of the sensor.</param>
        /// <param name="TOrE">Thermal/EM identifier for this sensor. false = thermal, true = EM</param>
        /// <param name="hard">Chance of destruction from electronic damage. 1.0 to 0.1</param>
        /// <param name="hardTech">Tech level of sensor hardening. This is to be adjusted downward by one, so level 0 is level 1.</param>
        public PassiveSensorDefTN(string title, float HS, byte sens, PassiveSensorType TOrE, float hard, byte hardTech)
        {
            Id            = Guid.NewGuid();
            componentType = ComponentTypeTN.PassiveSensor;

            Name        = title;
            size        = HS;
            Sensitivity = sens;
            ThermalOrEM = TOrE;
            Hardening   = hard;

            LookUpTableMax = 10000;

            /// <summary>
            /// Rating is the best way to compare sensors against each other.
            /// while Range tells me at what distance a signature of 1000 will be detected in KM.
            /// </summary>
            Rating = size * (float)Sensitivity;
            Range  = (int)(Rating * 100.0f);

            /// <summary>
            /// Populate the lookup table.
            /// </summary>
            LookUpTable = new BindingList <int>();
            for (ushort loop = 0; loop < LookUpTableMax; loop++)
            {
                int DetectionRange = CalcUnknownSignature(loop);
                LookUpTable.Add(DetectionRange);
            }

            ///<summary>
            ///HTK is either 1 or 0, because all sensors are very weak to damage, especially electronic damage.
            ///</summary>
            if (size >= 1.0)
            {
                htk = 1;
            }
            else
            {
                htk = 0;
            }

            /// <summary>
            /// Crew and cost are related to size, sensitivity, and hardening.
            /// </summary>
            crew = (byte)(size * 2.0);
            cost = (decimal)((size * (float)Sensitivity) + ((size * (float)Sensitivity) * 0.25f * (float)(hardTech - 1)));

            minerialsCost = new decimal[Constants.Minerals.NO_OF_MINERIALS];
            for (int mineralIterator = 0; mineralIterator < (int)Constants.Minerals.MinerialNames.MinerialCount; mineralIterator++)
            {
                minerialsCost[mineralIterator] = 0;
            }
            minerialsCost[(int)Constants.Minerals.MinerialNames.Uridium] = cost;

            if (size <= 1.0)
            {
                isMilitary = false;
            }
            else
            {
                isMilitary = true;
            }

            isObsolete  = false;
            isSalvaged  = false;
            isDivisible = false;

            isElectronic = true;
        }