Parcourir la source

Move the IntValue wrapper outside of DDSpellbook, since it doesn't belong there.

Sam Jaffe il y a 8 ans
Parent
commit
605ca3dc36

+ 2 - 3
src/main/lombok/org/leumasjaffe/charsheet/model/magic/DDSpellbook.java

@@ -3,7 +3,6 @@ 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;
@@ -29,8 +28,8 @@ public abstract class DDSpellbook extends Observable.Instance {
 
 	public boolean learnsSpells() { return false; }
 	public boolean preparesSpells() { return false; }
-	@JsonIgnore public IntValue getSharedAllowedSlots() {
-		return new IntValue(-1);
+	@JsonIgnore public int getSharedAllowedSlots() {
+		return -1;
 	}
 	
 	public int numSpellsKnownAtLevel( int level ) {

+ 2 - 2
src/main/lombok/org/leumasjaffe/charsheet/model/magic/impl/Researched.java

@@ -48,8 +48,8 @@ public class Researched extends Prepared {
 	@NonNull ClassReference classRef;
 
 	@Override
-	@JsonIgnore public IntValue getSharedAllowedSlots() {
-		return new IntValue(freeSpellsPerLevel);
+	@JsonIgnore public int getSharedAllowedSlots() {
+		return freeSpellsPerLevel;
 	}
 
 	@Override

+ 2 - 2
src/main/lombok/org/leumasjaffe/charsheet/view/level/LevelUpSpellPanel.java

@@ -96,7 +96,7 @@ class LevelUpSpellPanel extends JPanel {
 
 		panels = new ArrayList<>();
 
-		final IntValue val = getSharedAllowedSlots(info);
+		final IntValue val = new IntValue(getSharedAllowedSlots(info));
 		final Map<Integer, Integer> spells = getNewSpells(val);
 		final int sharedSlots = val.value();
 		BoolGate.Meta gate = readyCount.createSubGate(newHighestSpellLevel);
@@ -127,7 +127,7 @@ class LevelUpSpellPanel extends JPanel {
 		return map;
 	}
 
-	private IntValue getSharedAllowedSlots(Info info) {
+	private int getSharedAllowedSlots(ChooseSpellTuple info) {
 		return info.spellBook.getSharedAllowedSlots();
 	}