mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-02-01 10:24:30 +07:00
Created Excel for MonPreset
This commit is contained in:
parent
b8a5049adb
commit
532ec4f74e
@ -28,6 +28,7 @@ import com.riiablo.codec.excel.Misc;
|
||||
import com.riiablo.codec.excel.Missiles;
|
||||
import com.riiablo.codec.excel.MonAI;
|
||||
import com.riiablo.codec.excel.MonMode;
|
||||
import com.riiablo.codec.excel.MonPreset;
|
||||
import com.riiablo.codec.excel.MonStats;
|
||||
import com.riiablo.codec.excel.MonStats2;
|
||||
import com.riiablo.codec.excel.Obj;
|
||||
@ -85,6 +86,7 @@ public class Files {
|
||||
public final MonMode MonMode;
|
||||
public final MonStats monstats;
|
||||
public final MonStats2 monstats2;
|
||||
public final MonPreset MonPreset;
|
||||
public final Objects objects;
|
||||
public final ObjMode ObjMode;
|
||||
public final Overlay Overlay;
|
||||
@ -142,6 +144,7 @@ public class Files {
|
||||
MonMode = load(MonMode.class);
|
||||
monstats = load(MonStats.class, Excel.EXPANSION);
|
||||
monstats2 = load(MonStats2.class, Excel.EXPANSION);
|
||||
MonPreset = load(MonPreset.class, Excel.EXPANSION);
|
||||
RarePrefix = load(RarePrefix.class, Excel.EXPANSION);
|
||||
RareSuffix = load(RareSuffix.class, Excel.EXPANSION);
|
||||
Runes = load(Runes.class);
|
||||
|
45
core/src/com/riiablo/codec/excel/MonPreset.java
Normal file
45
core/src/com/riiablo/codec/excel/MonPreset.java
Normal file
@ -0,0 +1,45 @@
|
||||
package com.riiablo.codec.excel;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@Excel.Binned
|
||||
public class MonPreset extends Excel<MonPreset.Entry> {
|
||||
private static final int MAX_ACTS = 5;
|
||||
private static final int MAX_ENTRIES = 64;
|
||||
|
||||
private final int[][] lookup = new int[MAX_ACTS + 1][MAX_ENTRIES];
|
||||
private final int[] index = new int[MAX_ACTS + 1];
|
||||
|
||||
@Override
|
||||
protected void put(int id, Entry value) {
|
||||
super.put(id, value);
|
||||
int act = value.Act;
|
||||
lookup[act][index[act]++] = id;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
for (int act = 1; act <= MAX_ACTS; act++) {
|
||||
int[] lookup = this.lookup[act];
|
||||
Arrays.fill(lookup, index[act], lookup.length, -1);
|
||||
}
|
||||
}
|
||||
|
||||
public Entry get(int act, int id) {
|
||||
return get(lookup[act][id]);
|
||||
}
|
||||
|
||||
public String getPlace(int act, int id) {
|
||||
return get(act, id).Place;
|
||||
}
|
||||
|
||||
public int getSize(int act) {
|
||||
return index[act];
|
||||
}
|
||||
|
||||
@Excel.Index
|
||||
public static class Entry extends Excel.Entry {
|
||||
@Column public int Act;
|
||||
@Column public String Place;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user