云游商人

back_recharge
mengchengzhen 2021-04-16 14:02:11 +08:00
parent 87ab7cc69c
commit 2cafa21e1d
3 changed files with 53 additions and 3 deletions

View File

@ -82,7 +82,7 @@ public interface ActivityType {
int COW_FLY_SKY = 62;//牛气冲天
int LUCKY_GET = 63;//福星高照
int FIFTEEN_LOGIN = 64;//十五日签到
int EQUIP_UPLEVEL = 65;
int EQUIP_UPLEVEL = 65;//云游商人
int SUB_ACTIVITY = 8000;//易经宝库
int SKIN_RECHARGE_ACTIVITY = 71;

View File

@ -1,7 +1,14 @@
package config;
import manager.STableManager;
import manager.Table;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Table(name ="SComposeActivity")
public class SComposeActivity implements BaseConfig {
private int id;
@ -10,9 +17,33 @@ public class SComposeActivity implements BaseConfig {
private int count;
private int composeType;
private Map<Integer, Map<Integer,SComposeActivity>> configMap;
private Map<Integer, Map<Integer, List<Integer>>> itemMap;
@Override
public void init() throws Exception {
Map<Integer, Map<Integer,SComposeActivity>> tempConfigMap = new HashMap<>();
Map<Integer, Map<Integer, List<Integer>>> tempItemMap = new HashMap<>();
Map<Integer, SComposeActivity> config = STableManager.getConfig(SComposeActivity.class);
for(SComposeActivity activity : config.values()){
if(tempConfigMap.containsKey(activity.getActivityId())){
tempConfigMap.get(activity.getActivityId()).put(activity.getComposeType(),activity);
List<Integer> list = Arrays.stream( activity.getNeedItems() ).boxed().collect(Collectors.toList());
tempItemMap.get(activity.getActivityId()).put(activity.getComposeType(),list);
}else{
Map<Integer,SComposeActivity> map1 = new HashMap<>();
map1.put(activity.getComposeType(),activity);
tempConfigMap.put(activity.getActivityId(),map1);
Map<Integer,List<Integer>> map2 = new HashMap<>();
List<Integer> list = Arrays.stream( activity.getNeedItems() ).boxed().collect(Collectors.toList());
map2.put(activity.getComposeType(),list);
tempItemMap.put(activity.getActivityId(),map2);
}
}
if(configMap == null){
configMap = tempConfigMap;
itemMap = tempItemMap;
}
}
public int getId() {

View File

@ -1,7 +1,11 @@
package config;
import manager.STableManager;
import manager.Table;
import java.util.HashMap;
import java.util.Map;
@Table(name ="SComposeBook")
public class SComposeBook implements BaseConfig {
private int id;
@ -11,9 +15,24 @@ public class SComposeBook implements BaseConfig {
private int type;
private String desc;
private Map<Integer,Map<Integer,SComposeBook>> typeMap;
@Override
public void init() throws Exception {
Map<Integer,Map<Integer,SComposeBook>> tempTypeMap = new HashMap<>();
Map<Integer, SComposeBook> config = STableManager.getConfig(SComposeBook.class);
for(SComposeBook book : config.values()){
if(tempTypeMap.containsKey(book.getType())){
tempTypeMap.get(book.getType()).put(book.getGoalItems()[0],book);
}else{
Map<Integer,SComposeBook> map = new HashMap<>();
map.put(book.getGoalItems()[0],book);
tempTypeMap.put(book.getType(),map);
}
}
if(typeMap == null){
typeMap = tempTypeMap;
}
}
public int getId() {