DailyDungeonData.java 1.22 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package emu.grasscutter.data.def;

import java.util.Calendar;

import emu.grasscutter.data.GameData;
import emu.grasscutter.data.GameResource;
import emu.grasscutter.data.ResourceType;

import emu.grasscutter.game.props.SceneType;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;

@ResourceType(name = "DailyDungeonConfigData.json")
public class DailyDungeonData extends GameResource {
	private int Id;
	private int[] Monday;
	private int[] Tuesday;
	private int[] Wednesday;
	private int[] Thursday;
	private int[] Friday;
	private int[] Saturday;
	private int[] Sunday;
	
	private static final int[] empty = new int[0];
	private final Int2ObjectMap<int[]> map;
	
	public DailyDungeonData() {
		this.map = new Int2ObjectOpenHashMap<>();
	}
	    
	@Override
	public int getId() {
		return this.Id;
	}
	
	public int[] getDungeonsByDay(int day) {
		return map.getOrDefault(day, empty);
	}

	@Override
	public void onLoad() {
		map.put(Calendar.MONDAY, Monday);
		map.put(Calendar.TUESDAY, Tuesday);
		map.put(Calendar.WEDNESDAY, Wednesday);
		map.put(Calendar.THURSDAY, Thursday);
		map.put(Calendar.FRIDAY, Friday);
		map.put(Calendar.SATURDAY, Saturday);
		map.put(Calendar.SUNDAY, Sunday);
	}
}