Beispiel #1
0
 public void TriggerBehavior(BehaviorType pType)
 {
     if (pType == BehaviorType.None)
     {
         Console.WriteLine("ERROR: No behavior type specified for target ship");
     }
     else if (pType == BehaviorType.VelocityReversal)
     {
         Behavior_VelocityReversal b = new Behavior_VelocityReversal(this);
         b.Trigger();
         mActiveBehaviors.Add(b);
     }
     else if (pType == BehaviorType.PathLaser)
     {
         Behavior_PathLaser b = new Behavior_PathLaser(this);
         b.Trigger();
         mActiveBehaviors.Add(b);
     }
     else if (pType == BehaviorType.ThrustShip)
     {
         Behavior_ThrustShip b = new Behavior_ThrustShip(this);
         b.Trigger();
         mActiveBehaviors.Add(b);
     }
     else if (pType == BehaviorType.TurnLeft)
     {
         Behavior_TurnLeft b = new Behavior_TurnLeft(this);
         b.Trigger();
         mActiveBehaviors.Add(b);
     }
     else if (pType == BehaviorType.TurnRight)
     {
         Behavior_TurnRight b = new Behavior_TurnRight(this);
         b.Trigger();
         mActiveBehaviors.Add(b);
     }
     else if (pType == BehaviorType.SlowShip)
     {
         Behavior_SlowShip b = new Behavior_SlowShip(this);
         b.Trigger();
         mActiveBehaviors.Add(b);
     }
     else if (pType == BehaviorType.BulletSpam)
     {
         Behavior_BulletSpam b = new Behavior_BulletSpam(this);
         b.Trigger();
         mActiveBehaviors.Add(b);
     }
     else if (pType == BehaviorType.SuicideBomb)
     {
         Behavior_SuicideBomb b = new Behavior_SuicideBomb(this);
         b.Trigger();
         mActiveBehaviors.Add(b);
     }
     else if (pType == BehaviorType.ChargeLaser)
     {
         Behavior_ChargeLaser b = new Behavior_ChargeLaser(this);
         b.Trigger();
         mActiveBehaviors.Add(b);
     }
     else if (pType == BehaviorType.DualWield)
     {
         Behavior_DualWield b = new Behavior_DualWield(this);
         b.Trigger();
         mActiveBehaviors.Add(b);
     }
     else if (pType == BehaviorType.RearGuns)
     {
         Behavior_RearGuns b = new Behavior_RearGuns(this);
         b.Trigger();
         mActiveBehaviors.Add(b);
     }
     else
     {
         Console.WriteLine("ERROR: Behavior type was not a recognized BehaviorType");
     }
 }
Beispiel #2
0
 public void TriggerBehavior(BehaviorType pType)
 {
     if (pType == BehaviorType.None)
     {
         Console.WriteLine("ERROR: No behavior type specified for target ship");
     }
     else if (pType == BehaviorType.VelocityReversal)
     {
         Behavior_VelocityReversal b = new Behavior_VelocityReversal(this);
         b.Trigger();
         mActiveBehaviors.Add(b);
     }
     else if (pType == BehaviorType.PathLaser)
     {
         Behavior_PathLaser b = new Behavior_PathLaser(this);
         b.Trigger();
         mActiveBehaviors.Add(b);
     }
     else if (pType == BehaviorType.ThrustShip)
     {
         Behavior_ThrustShip b = new Behavior_ThrustShip(this);
         b.Trigger();
         mActiveBehaviors.Add(b);
     }
     else if (pType == BehaviorType.TurnLeft)
     {
         Behavior_TurnLeft b = new Behavior_TurnLeft(this);
         b.Trigger();
         mActiveBehaviors.Add(b);
     }
     else if (pType == BehaviorType.TurnRight)
     {
         Behavior_TurnRight b = new Behavior_TurnRight(this);
         b.Trigger();
         mActiveBehaviors.Add(b);
     }
     else if (pType == BehaviorType.SlowShip)
     {
         Behavior_SlowShip b = new Behavior_SlowShip(this);
         b.Trigger();
         mActiveBehaviors.Add(b);
     }
     else if (pType == BehaviorType.BulletSpam)
     {
         Behavior_BulletSpam b = new Behavior_BulletSpam(this);
         b.Trigger();
         mActiveBehaviors.Add(b);
     }
     else if (pType == BehaviorType.SuicideBomb)
     {
         Behavior_SuicideBomb b = new Behavior_SuicideBomb(this);
         b.Trigger();
         mActiveBehaviors.Add(b);
     }
     else if (pType == BehaviorType.ChargeLaser)
     {
         Behavior_ChargeLaser b = new Behavior_ChargeLaser(this);
         b.Trigger();
         mActiveBehaviors.Add(b);
     }
     else if (pType == BehaviorType.DualWield)
     {
         Behavior_DualWield b = new Behavior_DualWield(this);
         b.Trigger();
         mActiveBehaviors.Add(b);
     }
     else if (pType == BehaviorType.RearGuns)
     {
         Behavior_RearGuns b = new Behavior_RearGuns(this);
         b.Trigger();
         mActiveBehaviors.Add(b);
     }
     else
     {
         Console.WriteLine("ERROR: Behavior type was not a recognized BehaviorType");
     }
 }