Selaa lähdekoodia

Adding spellsPreparedPreviously, a field that allows us to reference the previous selection of spells for quick access.

Sam Jaffe 8 vuotta sitten
vanhempi
commit
b1747816e5

+ 8 - 3
resources/Potato.json

@@ -11,17 +11,20 @@
         "spellInfo":{
           "0":{
             "spellsPerDay":4,
-            "spellsPrepared":[]
+            "spellsPrepared":[],
+            "spellsPreparedPreviously":[]
           },
           "1":{
             "spellsPerDay":2,
             "spellsPrepared":[
               "Create Water"
-            ]
+            ],
+            "spellsPreparedPreviously":[]
           },
           "2":{
             "spellsPerDay":1,
-            "spellsPrepared":[]
+            "spellsPrepared":[],
+            "spellsPreparedPreviously":[]
           }
         }
       }
@@ -64,6 +67,8 @@
   "hair":"Plants",
   "skin":"Earthy",
   
+  "experience":10000,
+  
   "health":{
     "total":30,
     "rolled":20,

+ 2 - 2
src/org/leumasjaffe/charsheet/model/magic/impl/Inspired.java

@@ -21,7 +21,7 @@ public class Inspired implements DDSpellbook {
 	@AllArgsConstructor
 	@FieldDefaults(level=AccessLevel.PRIVATE, makeFinal=true)
 	private static class Level {
-		@NonNull List<DDSpell> spellsPrepared;
+		@NonNull List<DDSpell> spellsPrepared, spellsPreparedPreviously;
 		@NonFinal int spellsPerDay;
 	}
 	
@@ -65,6 +65,6 @@ public class Inspired implements DDSpellbook {
 	}
 	
 	private Level get(int level) {
-		return spellInfo.getOrDefault(level, new Level(Collections.emptyList(), 0));
+		return spellInfo.getOrDefault(level, new Level(Collections.emptyList(), Collections.emptyList(), 0));
 	}
 }

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

@@ -21,7 +21,7 @@ public class Researched implements DDSpellbook {
 	@FieldDefaults(level=AccessLevel.PRIVATE, makeFinal=true)
 	private static class Level {
 		@NonNull Collection<DDSpell> spellsKnown;
-		@NonNull List<DDSpell> spellsPrepared;
+		@NonNull List<DDSpell> spellsPrepared, spellsPreparedPreviously;
 		@NonFinal int spellsPerDay;
 	}
 	
@@ -52,6 +52,6 @@ public class Researched implements DDSpellbook {
 	
 
 	private Level get(int level) {
-		return spellInfo.getOrDefault(level, new Level(Collections.emptySet(), Collections.emptyList(), 0));
+		return spellInfo.getOrDefault(level, new Level(Collections.emptySet(), Collections.emptyList(), Collections.emptyList(), 0));
 	}
 }