public void TestEmpty()
 {
   ShotPatterns patterns = new ShotPatterns();
   foreach (ShotPattern shot in patterns)
   {
     Assert.Fail("Empty list returned a member anyway.");
   }
 }
Пример #2
0
        public void TestEmpty()
        {
            ShotPatterns patterns = new ShotPatterns();

            foreach (ShotPattern shot in patterns)
            {
                Assert.Fail("Empty list returned a member anyway.");
            }
        }
Пример #3
0
        public void TestOne()
        {
            ShotPatterns patterns = ShotPatterns.Create(new ShotPattern(0, Vector2.Zero, Effects.None));
            int          i        = 0;

            foreach (ShotPattern shot in patterns)
            {
                i++;
            }
            Assert.AreEqual(i, 1, "Wrong number of shots in iterator.");
        }
Пример #4
0
        public void TestChange()
        {
            ShotPatterns patterns = ShotPatterns.Create(new ShotPattern(0, Vector2.Zero, Effects.None));
            ShotPattern  p        = null;

            foreach (ShotPattern pattern in patterns)
            {
                p = pattern;
            }
            foreach (ShotPattern pattern in patterns)
            {
                Assert.AreNotSame(p, pattern, "ShotPattern can be edited externally.");
            }
        }
Пример #5
0
 public override void Apply()
 {
   ShotPatterns upgraded = new ShotPatterns();
   foreach (ShotPattern shot in UpgradeTarget.Shots)
   {
     if (keepExistingEffects)
     {
       shot.Effects |= newEffects;
     }
     else
     {
       shot.Effects = newEffects;
     }
     upgraded = upgraded.Add(shot);
   }
   UpgradeTarget.Shots = upgraded;
   UpgradeTarget.ApplyUpgrade(Type);
 }
Пример #6
0
        public override void Apply()
        {
            ShotPatterns upgraded = new ShotPatterns();

            foreach (ShotPattern shot in UpgradeTarget.Shots)
            {
                if (keepExistingEffects)
                {
                    shot.Effects |= newEffects;
                }
                else
                {
                    shot.Effects = newEffects;
                }
                upgraded = upgraded.Add(shot);
            }
            UpgradeTarget.Shots = upgraded;
            UpgradeTarget.ApplyUpgrade(Type);
        }
Пример #7
0
 public ShotUpgrade(IGun toUpgrade, ShotPatterns newShotPatterns, bool keepExistingShots, UpgradeType type)
     : base(toUpgrade, type)
 {
     this.newShotPatterns   = newShotPatterns;
     this.keepExistingShots = keepExistingShots;
 }
Пример #8
0
 public ShotArgs(ShotPatterns s)
 {
   this.s = s;
 }
Пример #9
0
 public ShotUpgrade(IGun toUpgrade, ShotPatterns newShotPatterns, bool keepExistingShots, UpgradeType type)
   : base(toUpgrade, type)
 {
   this.newShotPatterns = newShotPatterns;
   this.keepExistingShots = keepExistingShots;
 }
Пример #10
0
 public ShotArgs(ShotPatterns s)
 {
     this.s = s;
 }