Added Pool and LootTable
This commit is contained in:
parent
75c0138859
commit
69bf747119
@ -0,0 +1,12 @@
|
||||
package com.cimeyclust.addonreader.resources;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LootTable {
|
||||
public List<Pool> pools;
|
||||
|
||||
public LootTable() {
|
||||
this.pools = new ArrayList<>();
|
||||
}
|
||||
}
|
||||
22
src/main/java/com/cimeyclust/addonreader/resources/Pool.java
Normal file
22
src/main/java/com/cimeyclust/addonreader/resources/Pool.java
Normal file
@ -0,0 +1,22 @@
|
||||
package com.cimeyclust.addonreader.resources;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class Pool {
|
||||
public int rolls;
|
||||
public Map<String, Integer> entries;
|
||||
|
||||
public Pool(int rolls, Map<String, Integer> entries) {
|
||||
this.rolls = rolls;
|
||||
this.entries = new HashMap<>();
|
||||
}
|
||||
|
||||
public int getTotalWeight() {
|
||||
int totalWeight = 0;
|
||||
for (int weight : entries.values()) {
|
||||
totalWeight += weight;
|
||||
}
|
||||
return totalWeight;
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user