/** Regenerates mana for the player based on the regen amounts of professed classes */ public void regenMana() { double amount = 0; for (PlayerClass c : classes.values()) { if (c.getData().hasManaRegen()) { amount += c.getData().getManaRegen(); } } if (amount > 0) { giveMana(amount, ManaSource.REGEN); } }
/** * Gives mana to the player from an unknown source. This will not cause the player's mana to go * above their max amount. * * @param amount amount of mana to give */ public void giveMana(double amount) { giveMana(amount, ManaSource.SPECIAL); }