mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-22 11:54:39 +01:00
Implement dungeon completion
This commit is contained in:
@@ -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<>();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user