| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- package org.leumasjaffe.charsheet.model.magic;
- import java.util.Collection;
- import java.util.List;
- import org.leumasjaffe.observer.Observable;
- import com.fasterxml.jackson.annotation.JsonIgnore;
- import com.fasterxml.jackson.annotation.JsonTypeInfo;
- import com.fasterxml.jackson.annotation.JsonTypeInfo.Id;
- import lombok.NonNull;
- @JsonTypeInfo(use = Id.MINIMAL_CLASS)
- public abstract class DDSpellbook extends Observable.Instance {
- @NonNull public abstract Collection<DDSpell> spellsKnownAtLevel( int level );
- @NonNull public abstract List<DDSpell> spellsPreparedAtLevel( int level );
-
- @NonNull public List<DDSpell> getSpellsPreparedPreviouslyForLevel(int level) { return spellsPreparedAtLevel(level); }
- public boolean learnsSpells() { return false; }
- public boolean preparesSpells() { return false; }
- @JsonIgnore public int getSharedAllowedSlots() {
- return -1;
- }
-
- public int numSpellsKnownAtLevel( int level ) {
- return spellsKnownAtLevel( level ).size();
- }
-
- public abstract int numSpellsPerDayAtLevel( int level );
-
- public int numSpellsPerDayRemainingAtLevel(int level) {
- return spellsPreparedAtLevel( level ).size();
- }
-
- public abstract void castSpell( int level, final DDSpell spell );
-
- public void learnSpells(int level, Collection<DDSpell> known) {
- throw new UnsupportedOperationException("This class does not have a list of known spells to edit");
- }
- public abstract void prepareSpells(int level, Collection<DDSpell> collection);
- }
|