public int getPowerUpPrice(PowerupBase.EType powerUptype) { switch (powerUptype) { case PowerupBase.EType.HINT_WORD: return(5); case PowerupBase.EType.BLOCK: return(5); case PowerupBase.EType.BOMB: return(10); case PowerupBase.EType.DESTROY: return(25); case PowerupBase.EType.ROTATE: return(15); case PowerupBase.EType.WILDCARD: return(50); } return(0); }
public bool hasStockThisPowerup(PowerupBase.EType powerupType) { if (getPowerupByType(powerupType).stock > 0) { return(true); } return(false); }
public PowerupBase getPowerupByType(PowerupBase.EType type) { foreach (PowerupBase powerup in powerups) { if (powerup != null) { if (powerup.type == type) { return(powerup); } } } return(null); }
public void activatePowerUp(PowerupBase.EType wichOne, bool canUse) { if (allowPowerUps) { powerup = getPowerupByType(wichOne); if (powerup == null) { cancelPowerup(); } else { powerup.activate(canUse); } } }
public void consumePowerupStock(PowerupBase.EType type) { getPowerupByType(type).updateStock(-1); }
public void addPowerupStock(PowerupBase.EType type, int amount) { getPowerupByType(type).updateStock(amount); }