72 lines
1.6 KiB
Java
72 lines
1.6 KiB
Java
|
package config;
|
||
|
|
||
|
import manager.STableManager;
|
||
|
import manager.Table;
|
||
|
|
||
|
import java.util.ArrayList;
|
||
|
import java.util.HashMap;
|
||
|
import java.util.List;
|
||
|
import java.util.Map;
|
||
|
|
||
|
@Table(name ="TreasureConfig")
|
||
|
public class STreasureConfig implements BaseConfig {
|
||
|
|
||
|
private int id;
|
||
|
|
||
|
private int activityId;
|
||
|
|
||
|
private int type;
|
||
|
|
||
|
private int points;
|
||
|
|
||
|
private int[][] reward;
|
||
|
|
||
|
private int[][] treasureReward;
|
||
|
|
||
|
public static Map<Integer, List<STreasureConfig>> configByActivityIdMap = new HashMap<>();
|
||
|
public static Map<Integer, STreasureConfig> configMap = new HashMap<>();
|
||
|
|
||
|
|
||
|
@Override
|
||
|
public void init() throws Exception {
|
||
|
Map<Integer, STreasureConfig> config = STableManager.getConfig(STreasureConfig.class);
|
||
|
Map<Integer, List<STreasureConfig>> configByActivityIdMapTmp = new HashMap<>();
|
||
|
for(STreasureConfig sTreasureConfig : config.values()){
|
||
|
int activityId = sTreasureConfig.getActivityId();
|
||
|
if(!configByActivityIdMapTmp.containsKey(activityId)){
|
||
|
configByActivityIdMapTmp.put(activityId,new ArrayList<>());
|
||
|
}
|
||
|
configByActivityIdMapTmp.get(activityId).add(sTreasureConfig);
|
||
|
}
|
||
|
configByActivityIdMap = configByActivityIdMapTmp;
|
||
|
configMap = config;
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
public int getId() {
|
||
|
return id;
|
||
|
}
|
||
|
|
||
|
public int getActivityId() {
|
||
|
return activityId;
|
||
|
}
|
||
|
|
||
|
public int getType() {
|
||
|
return type;
|
||
|
}
|
||
|
|
||
|
public int getPoints() {
|
||
|
return points;
|
||
|
}
|
||
|
|
||
|
public int[][] getReward() {
|
||
|
return reward;
|
||
|
}
|
||
|
|
||
|
public int[][] getTreasureReward() {
|
||
|
return treasureReward;
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|