Added Pool and LootTable

This commit is contained in:
Verox001 2023-07-23 11:49:29 +02:00
parent 75c0138859
commit 69bf747119
2 changed files with 34 additions and 0 deletions

View File

@ -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<>();
}
}

View 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;
}
}