コード例 #1
0
ファイル: Character.cs プロジェクト: nubington/bill
 public PowerUp getActivePowerUp(PowerUpType type)
 {
     foreach (PowerUp p in ActivePowerUps)
     {
         if (p.Type == type)
         {
             return(p);
         }
     }
     return(null);
 }
コード例 #2
0
 public static bool IsPowerUpAlive(PowerUpType type)
 {
     foreach (PowerUp p in AlivePowerUps)
     {
         if (p.Type == type)
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #3
0
ファイル: Character.cs プロジェクト: nubington/bill
 public bool hasPowerUp(PowerUpType type)
 {
     foreach (PowerUp p in ActivePowerUps)
     {
         if (p.Type == type)
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #4
0
ファイル: Character.cs プロジェクト: nubington/bill
 public void removePowerUp(PowerUpType type)
 {
     for (int i = 0; i < ActivePowerUps.Count;)
     {
         PowerUp p = ActivePowerUps[i];
         if (p.Type == type)
         {
             ActivePowerUps.Remove(p);
         }
         else
         {
             i++;
         }
     }
 }
コード例 #5
0
ファイル: PowerUp.cs プロジェクト: nubington/bill
 private PowerUp(Rectangle rectangle, PowerUpType type)
     : base(rectangle, new Vector2(0, 0))
 {
     this.type = type;
     this.Texture = type.Texture;
     aliveDuration = type.AliveDuration;
     if (type == PowerUpType.SledgeHammer)
         activeDuration = GameSettings.DEFAULTSLEDGEHAMMERACTIVEDURATION;
     else if (type == PowerUpType.CanShield)
         activeDuration = GameSettings.DEFAULTCANSHIELDACTIVEDURATION;
     else
         activeDuration = type.ActiveDuration;
     Charges = type.Charges;
     aliveTimer = new Stopwatch();
     activeTimer = new Stopwatch();
     aliveTimer.Start();
 }
コード例 #6
0
 private PowerUp(Rectangle rectangle, PowerUpType type)
     : base(rectangle, new Vector2(0, 0))
 {
     this.type     = type;
     this.Texture  = type.Texture;
     aliveDuration = type.AliveDuration;
     if (type == PowerUpType.SledgeHammer)
     {
         activeDuration = GameSettings.DEFAULTSLEDGEHAMMERACTIVEDURATION;
     }
     else if (type == PowerUpType.CanShield)
     {
         activeDuration = GameSettings.DEFAULTCANSHIELDACTIVEDURATION;
     }
     else
     {
         activeDuration = type.ActiveDuration;
     }
     Charges     = type.Charges;
     aliveTimer  = new Stopwatch();
     activeTimer = new Stopwatch();
     aliveTimer.Start();
 }
コード例 #7
0
ファイル: PowerUp.cs プロジェクト: nubington/bill
 public static bool IsPowerUpAlive(PowerUpType type)
 {
     foreach (PowerUp p in AlivePowerUps)
         if (p.Type == type)
             return true;
     return false;
 }
コード例 #8
0
ファイル: Character.cs プロジェクト: nubington/bill
 public void removePowerUp(PowerUpType type)
 {
     for (int i = 0; i < ActivePowerUps.Count; )
     {
         PowerUp p = ActivePowerUps[i];
         if (p.Type == type)
             ActivePowerUps.Remove(p);
         else
             i++;
     }
 }
コード例 #9
0
ファイル: Character.cs プロジェクト: nubington/bill
 public bool hasPowerUp(PowerUpType type)
 {
     foreach (PowerUp p in ActivePowerUps)
         if (p.Type == type)
             return true;
     return false;
 }
コード例 #10
0
ファイル: Character.cs プロジェクト: nubington/bill
 public PowerUp getActivePowerUp(PowerUpType type)
 {
     foreach (PowerUp p in ActivePowerUps)
         if (p.Type == type)
             return p;
     return null;
 }