public PowerUp getActivePowerUp(PowerUpType type) { foreach (PowerUp p in ActivePowerUps) { if (p.Type == type) { return(p); } } return(null); }
public static bool IsPowerUpAlive(PowerUpType type) { foreach (PowerUp p in AlivePowerUps) { if (p.Type == type) { return(true); } } return(false); }
public bool hasPowerUp(PowerUpType type) { foreach (PowerUp p in ActivePowerUps) { if (p.Type == type) { return(true); } } return(false); }
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++; } } }
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(); }
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(); }
public static bool IsPowerUpAlive(PowerUpType type) { foreach (PowerUp p in AlivePowerUps) if (p.Type == type) return true; return false; }
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++; } }
public bool hasPowerUp(PowerUpType type) { foreach (PowerUp p in ActivePowerUps) if (p.Type == type) return true; return false; }
public PowerUp getActivePowerUp(PowerUpType type) { foreach (PowerUp p in ActivePowerUps) if (p.Type == type) return p; return null; }