| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- package org.leumasjaffe.charsheet.model.magic;
- import java.util.Collection;
- import java.util.List;
- import org.leumasjaffe.charsheet.model.observable.IntValue;
- 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.Getter;
- import lombok.NonNull;
- import lombok.Setter;
- @JsonTypeInfo(use = Id.MINIMAL_CLASS)
- public abstract class DDSpellbook extends Observable.Instance {
- public interface Secondary {
- DDSpellbook getMainSpellbook();
- void setMainSpellbook(DDSpellbook spellBook);
- }
-
- @Getter @Setter String name;
- @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 IntValue getSharedAllowedSlots() {
- return new IntValue(-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 String getSingleName() {
- return getName();
- }
- 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);
- }
|