Example #1
0
        /// <summary>
        /// the actual ship armor constructor does nothing with armorColumns or armorDamage yet.
        /// </summary>
        public ArmorTN(ArmorDefTN protectionDef)
        {
            m_oIsDamaged    = false;
            m_lArmorColumns = new BindingList <ushort>();
            m_lArmorDamage  = new Dictionary <ushort, ushort>();
            m_oArmorDef     = protectionDef;

            Name = protectionDef.Name;

            /// <summary>
            /// This won't be used but will be set in any event.
            /// </summary>
            isDestroyed = false;
        }
Example #2
0
        /// <summary>
        /// the actual ship armor constructor does nothing with armorColumns or armorDamage yet.
        /// </summary>
        public ArmorTN(ArmorDefTN protectionDef)
        {
            m_oIsDamaged = false;
            m_lArmorColumns = new BindingList<ushort>();
            m_lArmorDamage = new Dictionary<ushort, ushort>();
            m_oArmorDef = protectionDef;

            Name = protectionDef.Name;

            /// <summary>
            /// This won't be used but will be set in any event.
            /// </summary>
            isDestroyed = false;
        }
Example #3
0
        /// <summary>
        /// This constructor will initialize the craft class to a default conventional armored 0 space ship, with a deployment time of 3 months and a name of title.
        /// </summary>
        /// <param name="Title">Class name</param>
        public ShipClassTN(string Title, Faction ShipClassFaction)
            : base()
        {
            Name = Title;
            Faction = ShipClassFaction;

            ShipsInClass = new BindingList<ShipTN>();
            ShipsUnderConstruction = 0;

            /// <summary>
            /// Sanity initializations
            /// </summary>
            BuildPointCost = 0.0m;
            m_aiMinerialsCost = new decimal[Constants.Minerals.NO_OF_MINERIALS];
            for (int mineralIterator = 0; mineralIterator < (int)Constants.Minerals.MinerialNames.MinerialCount; mineralIterator++)
            {
                m_aiMinerialsCost[mineralIterator] = 0;
            }
            SizeHS = 0.0f;
            SizeTons = 0.0f;
            TotalHTK = 0;
            IsMilitary = false;
            IsTanker = false;
            IsSupply = false;
            IsCollier = false;
            IsLocked = false;
            MilitaryComponentCount = 0;
            PlanetaryProtectionValue = 0;
            Notes = "None.";

            ListOfComponentDefs = new BindingList<ComponentDefTN>();
            ListOfComponentDefsCount = new BindingList<short>();
            DamageAllocationChart = new Dictionary<ComponentDefTN, int>();
            ElectronicDamageAllocationChart = new Dictionary<ComponentDefTN, int>();

            CrewQuarters = new BindingList<GeneralComponentDefTN>();
            CrewQuartersCount = new BindingList<ushort>();
            TotalCrewQuarters = 0;
            TotalRequiredCrew = 0;
            SpareCrewQuarters = 0;
            SpareCryoBerths = 0;
            MaxDeploymentTime = 3;
            TonsPerMan = (float)Math.Pow((double)MaxDeploymentTime, (1.0 / 3.0));
            CapPerHS = 50.0f / TonsPerMan;
            AccomHSRequirement = 0.0f;
            AccomHSAvailable = 0.0f;

            FuelTanks = new BindingList<GeneralComponentDefTN>();
            FuelTanksCount = new BindingList<ushort>();
            TotalFuelCapacity = 0.0f;

            EngineeringBays = new BindingList<GeneralComponentDefTN>();
            EngineeringBaysCount = new BindingList<ushort>();
            TotalMSPCapacity = 0;
            EngineeringHS = 0.0f;
            MaintenanceLife = 0.0f;
            AnnualFailureRate = 0.0f;
            InitialFailureRate = 0.0f;
            YearOneFailureTotal = 0.0f;
            YearFiveFailureTotal = 0.0f;
            MaxDamageControlRating = 0;
            MaxRepair = 0;

            OtherComponents = new BindingList<GeneralComponentDefTN>();
            OtherComponentsCount = new BindingList<ushort>();
            HasBridge = false;


            MaxFuelUsePerHour = 0.0f;
            ShipEngineCount = 0;

            MaxEnginePower = 0;
            MaxThermalSignature = 0;
            MaxSpeed = 0;

            ShipCargoDef = new BindingList<CargoDefTN>();
            ShipCargoCount = new BindingList<ushort>();
            TotalCargoCapacity = 0;
            CargoLoadTime = 0;

            ShipCHSDef = new BindingList<CargoHandlingDefTN>();
            ShipCHSCount = new BindingList<ushort>();
            TractorMultiplier = 1;

            ShipColonyDef = new BindingList<ColonyDefTN>();
            ShipColonyCount = new BindingList<ushort>();
            CryoLoadTime = 0;

            TroopLoadTime = 0;


            ShipPSensorDef = new BindingList<PassiveSensorDefTN>();
            ShipPSensorCount = new BindingList<ushort>();
            BestThermalRating = 1;
            BestEMRating = 1;

            ShipASensorDef = new BindingList<ActiveSensorDefTN>();
            ShipASensorCount = new BindingList<ushort>();
            TotalCrossSection = 0;
            MaxEMSignature = 0;

            ShipBFCDef = new BindingList<BeamFireControlDefTN>();
            ShipBFCCount = new BindingList<ushort>();
            ShipBeamDef = new BindingList<BeamDefTN>();
            ShipBeamCount = new BindingList<ushort>();

            ShipReactorDef = new BindingList<ReactorDefTN>();
            ShipReactorCount = new BindingList<ushort>();

            TotalPowerGeneration = 0;
            TotalPowerRequirement = 0;

            ShipShieldDef = null;
            ShipShieldCount = 0;
            TotalShieldPool = 0.0f;
            TotalShieldFuelCostPerTick = 0.0f;
            TotalShieldGenPerTick = 0.0f;

            ShipMLaunchDef = new BindingList<MissileLauncherDefTN>();
            ShipMLaunchCount = new BindingList<ushort>();
            ShipMagazineDef = new BindingList<MagazineDefTN>();
            ShipMagazineCount = new BindingList<ushort>();
            ShipMFCDef = new BindingList<ActiveSensorDefTN>();
            ShipMFCCount = new BindingList<ushort>();
            TotalMagazineCapacity = 0;
            ShipClassOrdnance = new Dictionary<OrdnanceDefTN, int>();
            PreferredOrdnanceSize = 0;
            PreferredOrdnanceCost = 0.0m;
            LargestLauncher = 0;
            LauncherMagSpace = 0;
            MagazineMagSpace = 0;
            LauncherCount = 0;
            PreferredOrdnanceCount = 0;

            ShipCIWSDef = new BindingList<CIWSDefTN>();
            ShipCIWSCount = new BindingList<ushort>();

            ShipTurretDef = new BindingList<TurretDefTN>();
            ShipTurretCount = new BindingList<ushort>();

            ShipJumpEngineDef = new BindingList<JumpEngineDefTN>();
            ShipJumpEngineCount = new BindingList<int>();
            SquadronSize = 0;
            JumpRadius = 0;

            ShipArmorDef = new ArmorDefTN("Conventional");
            NewArmor("Conventional", 2, 1);

            BuildPointCost = ShipArmorDef.cost;
        }