Implement dungeon completion

This commit is contained in:
KingRainbow44
2023-05-01 01:10:15 -04:00
parent aadbc05061
commit 916db0f408
3 changed files with 30 additions and 3 deletions

View File

@@ -4,6 +4,9 @@ import dev.morphia.annotations.Entity;
import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import java.util.Map;
import it.unimi.dsi.fastutil.ints.IntArrayList;
import it.unimi.dsi.fastutil.ints.IntList;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@@ -12,9 +15,14 @@ import lombok.val;
/** Tracks progress the player made in the world, like obtained items, seen characters and more */
@Entity
public class PlayerProgress {
@Getter private Map<Integer, ItemEntry> itemHistory;
/*
* A list of dungeon IDs which have been completed.
* This only applies to one-time dungeons.
*/
@Getter private IntList completedDungeons;
// keep track of EXEC_ADD_QUEST_PROGRESS count, will be used in CONTENT_ADD_QUEST_PROGRESS
// not sure where to put this, this should be saved to DB but not to individual quest, since
// it will be hard to loop and compare
@@ -22,6 +30,7 @@ public class PlayerProgress {
public PlayerProgress() {
this.questProgressCountMap = new Int2IntOpenHashMap();
this.completedDungeons = new IntArrayList();
this.itemHistory = new Int2ObjectOpenHashMap<>();
}