public static void DecorateShip(IStarShip ship, IDefendImplement defendImplement)
 {
     if (ship.NumberOfDefendSlotsAvailable >= defendImplement.Size)
     {
         ship.DefendImplements.Add(defendImplement);
         ship.Health = ship.Health + defendImplement.ShipHealthModification;
         ship.Speed  = ship.Speed + defendImplement.ShipSpeedModification;
         ship.Power  = ship.Power + defendImplement.ShipPowerModification;
         ship.Armor  = ship.Armor + defendImplement.ShipArmorModification;
         if (ship.Health < 0)
         {
             ship.Health = 0;
         }
         if (ship.Speed < 0)
         {
             ship.Speed = 0;
         }
         if (ship.Power < 0)
         {
             ship.Power = 0;
         }
         if (ship.Armor < 0)
         {
             ship.Armor = 0;
         }
     }
 }
예제 #2
0
 private static void SetShieldBoosterDefaultValues(IDefendImplement defendImplement)
 {
     defendImplement.Power  = 40;
     defendImplement.Health = 100;
     defendImplement.Size   = 10;
     defendImplement.ShipHealthModification = 30;
     defendImplement.ShipArmorModification  = 30;
     defendImplement.ShipSpeedModification  = -8;
 }
예제 #3
0
 private static void SetPolarizedPlatingDefaultValues(IDefendImplement defendImplement)
 {
     defendImplement.Power  = 100;
     defendImplement.Health = 100;
     defendImplement.Size   = 5;
     defendImplement.ShipHealthModification = 10;
     defendImplement.ShipArmorModification  = 10;
     defendImplement.ShipSpeedModification  = -2;
 }
예제 #4
0
 private static void SetDeflectionShieldDefaultValues(IDefendImplement defendImplement)
 {
     defendImplement.Power  = 60;
     defendImplement.Health = 100;
     defendImplement.Size   = 3;
     defendImplement.ShipHealthModification = 20;
     defendImplement.ShipArmorModification  = 20;
     defendImplement.ShipSpeedModification  = -4;
 }
        public void PolarizedPlatingShipSpeedModificationBaseValueTest()
        {
            IDefendImplement upgradeImplement = DefendImplementFactory.CreateDefendImplement(DefendImplementType.PolarizedPlating);

            Assert.Equal(-2, upgradeImplement.ShipSpeedModification);
        }
        public void PolarizedPlatingHealthBaseValueTest()
        {
            IDefendImplement upgradeImplement = DefendImplementFactory.CreateDefendImplement(DefendImplementType.PolarizedPlating);

            Assert.Equal(100, upgradeImplement.Health);
        }
        public void PolarizedPlatingSizeBaseValueTest()
        {
            IDefendImplement upgradeImplement = DefendImplementFactory.CreateDefendImplement(DefendImplementType.PolarizedPlating);

            Assert.Equal(5, upgradeImplement.Size);
        }
        public void PolarizedPlatingPowerBaseValueTest()
        {
            IDefendImplement defendImplement = DefendImplementFactory.CreateDefendImplement(DefendImplementType.PolarizedPlating);

            Assert.Equal(100, defendImplement.Power);
        }
        public void ShieldBoosterShipSpeedModificationBaseValueTest()
        {
            IDefendImplement upgradeImplement = DefendImplementFactory.CreateDefendImplement(DefendImplementType.ShieldBooster);

            Assert.Equal(-8, upgradeImplement.ShipSpeedModification);
        }
        public void ShieldBoosterHealthBaseValueTest()
        {
            IDefendImplement upgradeImplement = DefendImplementFactory.CreateDefendImplement(DefendImplementType.ShieldBooster);

            Assert.Equal(100, upgradeImplement.Health);
        }
        public void ShieldBoosterPowerBaseValueTest()
        {
            IDefendImplement defendImplement = DefendImplementFactory.CreateDefendImplement(DefendImplementType.ShieldBooster);

            Assert.Equal(40, defendImplement.Power);
        }
예제 #12
0
        public void DeflectionShieldsShipSpeedModificationBaseValueTest()
        {
            IDefendImplement upgradeImplement = DefendImplementFactory.CreateDefendImplement(DefendImplementType.DeflectionShield);

            Assert.Equal(-4, upgradeImplement.ShipSpeedModification);
        }
예제 #13
0
        public void DeflectionShieldsHealthBaseValueTest()
        {
            IDefendImplement upgradeImplement = DefendImplementFactory.CreateDefendImplement(DefendImplementType.DeflectionShield);

            Assert.Equal(100, upgradeImplement.Health);
        }
예제 #14
0
        public void DeflectionShieldSizeBaseValueTest()
        {
            IDefendImplement upgradeImplement = DefendImplementFactory.CreateDefendImplement(DefendImplementType.DeflectionShield);

            Assert.Equal(3, upgradeImplement.Size);
        }
예제 #15
0
        public void DeflectionShieldPowerBaseValueTest()
        {
            IDefendImplement defendImplement = DefendImplementFactory.CreateDefendImplement(DefendImplementType.DeflectionShield);

            Assert.Equal(60, defendImplement.Power);
        }