Unicopia/src/main/java/com/minelittlepony/unicopia/spell/ILevelled.java
2018-09-24 21:37:16 +02:00

26 lines
583 B
Java

package com.minelittlepony.unicopia.spell;
public interface ILevelled {
/**
* Maximum level this spell can reach or -1 for unlimited.
* <br>
* If a gem goes past this level it is more likely to explode.
*/
default int getMaxLevel() {
return 0;
}
default boolean canLevelUp() {
int max = getMaxLevel();
return max < 0 || getCurrentLevel() < max;
}
int getCurrentLevel();
void setCurrentLevel(int level);
default void addLevels(int levels) {
setCurrentLevel(getCurrentLevel() + levels);
}
}