Exemple #1
0
        /// <summary>
        /// Constructs a ScenarioElementTypeUpgrade instance for the given scenario element and for the given type.
        /// </summary>
        /// <param name="metadataUpgrade">The metadata upgrade that this instance belongs to.</param>
        /// <param name="elementTypeName">The name of the element type that this instance is upgrading.</param>
        public ScenarioElementTypeUpgrade(ScenarioMetadataUpgrade metadataUpgrade, string elementTypeName)
        {
            if (metadataUpgrade == null)
            {
                throw new ArgumentNullException("metadataUpgrade");
            }
            if (elementTypeName == null)
            {
                throw new ArgumentNullException("elementTypeName");
            }

            this.metadataUpgrade                  = metadataUpgrade;
            this.elementTypeName                  = elementTypeName;
            this.standardWeaponDataUpgrades       = null;
            this.standardWeaponDataUpgradesByName = null;
            this.customWeaponDataUpgrades         = null;
            this.customWeaponDataUpgradesByName   = null;

            this.armorModifier      = new IntValueModifier();
            this.maxEnergyModifier  = new IntValueModifier();
            this.sightRangeModifier = new IntValueModifier();
            this.speedModifier      = new NumberValueModifier();

            this.relativeQuadCoordsInSight = null;
            this.lastKnownSightRange       = -1;

            this.Reset();
        }
Exemple #2
0
        /// <summary>
        /// Constructs a WeaponDataUpgrade instance.
        /// </summary>
        /// <param name="metadataUpgrade">The metadata upgrade that this instance belongs to.</param>
        /// <param name="originalWeaponData">The original weapon data that this instance is upgrading.</param>
        public WeaponDataUpgrade(ScenarioMetadataUpgrade metadataUpgrade, IWeaponData originalWeaponData)
        {
            if (metadataUpgrade == null)
            {
                throw new ArgumentNullException("metadataUpgrade");
            }
            if (originalWeaponData == null)
            {
                throw new ArgumentNullException("originalWeaponData");
            }

            this.metadataUpgrade     = metadataUpgrade;
            this.missileDataWrappers = new List <MissileDataWrapper>();

            this.damageModifier   = new IntValueModifier();
            this.cooldownModifier = new IntValueModifier();
            this.rangeMaxModifier = new IntValueModifier();
            this.rangeMinModifier = new IntValueModifier();

            this.Reset(originalWeaponData);
        }