本文整理汇总了Java中rescuecore2.config.Config类的典型用法代码示例。如果您正苦于以下问题:Java Config类的具体用法?Java Config怎么用?Java Config使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Config类属于rescuecore2.config包,在下文中一共展示了Config类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setValue
import rescuecore2.config.Config; //导入依赖的package包/类
@Override
public void setValue(Config config, String[] datas) {
if(datas.length == 3) {
config.setValue(ConfigKey.KEY_POLICE_AGENT_NAME, datas[1]);
config.setValue(ConfigKey.KEY_POLICE_AGENT_COUNT, datas[2]);
}
else if(datas.length == 2) {
config.setValue(ConfigKey.KEY_POLICE_AGENT_COUNT, datas[1]);
}
else if(datas.length == 4) {
config.setValue(ConfigKey.KEY_POLICE_AGENT_NAME, datas[1]);
config.setValue(ConfigKey.KEY_POLICE_AGENT_COUNT, datas[2]);
config.setValue(ConfigKey.KEY_POLICE_STATION_COUNT, datas[3]);
}
else if(datas.length == 5) {
config.setValue(ConfigKey.KEY_POLICE_AGENT_NAME, datas[1]);
config.setValue(ConfigKey.KEY_POLICE_AGENT_COUNT, datas[2]);
config.setValue(ConfigKey.KEY_POLICE_STATION_NAME, datas[3]);
config.setValue(ConfigKey.KEY_POLICE_STATION_COUNT, datas[4]);
}
}
示例2: setValue
import rescuecore2.config.Config; //导入依赖的package包/类
@Override
public void setValue(Config config, String[] datas) {
if(datas.length == 3) {
config.setValue(ConfigKey.KEY_FIRE_AGENT_NAME, datas[1]);
config.setValue(ConfigKey.KEY_FIRE_AGENT_COUNT, datas[2]);
}
else if(datas.length == 2) {
config.setValue(ConfigKey.KEY_FIRE_AGENT_COUNT, datas[1]);
}
else if(datas.length == 4) {
config.setValue(ConfigKey.KEY_FIRE_AGENT_NAME, datas[1]);
config.setValue(ConfigKey.KEY_FIRE_AGENT_COUNT, datas[2]);
config.setValue(ConfigKey.KEY_FIRE_STATION_COUNT, datas[3]);
}
else if(datas.length == 5) {
config.setValue(ConfigKey.KEY_FIRE_AGENT_NAME, datas[1]);
config.setValue(ConfigKey.KEY_FIRE_AGENT_COUNT, datas[2]);
config.setValue(ConfigKey.KEY_FIRE_STATION_NAME, datas[3]);
config.setValue(ConfigKey.KEY_FIRE_STATION_COUNT, datas[4]);
}
}
示例3: setValue
import rescuecore2.config.Config; //导入依赖的package包/类
@Override
public void setValue(Config config, String[] datas) {
if(datas.length == 3) {
config.setValue(ConfigKey.KEY_AMBULANCE_AGENT_NAME, datas[1]);
config.setValue(ConfigKey.KEY_AMBULANCE_AGENT_COUNT, datas[2]);
}
else if(datas.length == 2) {
config.setValue(ConfigKey.KEY_AMBULANCE_AGENT_COUNT, datas[1]);
}
else if(datas.length == 4) {
config.setValue(ConfigKey.KEY_AMBULANCE_AGENT_NAME, datas[1]);
config.setValue(ConfigKey.KEY_AMBULANCE_AGENT_COUNT, datas[2]);
config.setValue(ConfigKey.KEY_AMBULANCE_STATION_COUNT, datas[3]);
}
else if(datas.length == 5) {
config.setValue(ConfigKey.KEY_AMBULANCE_AGENT_NAME, datas[1]);
config.setValue(ConfigKey.KEY_AMBULANCE_AGENT_COUNT, datas[2]);
config.setValue(ConfigKey.KEY_AMBULANCE_STATION_NAME, datas[3]);
config.setValue(ConfigKey.KEY_AMBULANCE_STATION_COUNT, datas[4]);
}
}
示例4: setValue
import rescuecore2.config.Config; //导入依赖的package包/类
@Override
public void setValue(Config config, String[] datas) {
if(datas.length == 8) {
config.setValue(ConfigKey.KEY_FIRE_AGENT_NAME, datas[1]);
config.setValue(ConfigKey.KEY_FIRE_STATION_NAME, datas[1]);
config.setValue(ConfigKey.KEY_POLICE_AGENT_NAME, datas[1]);
config.setValue(ConfigKey.KEY_POLICE_STATION_NAME, datas[1]);
config.setValue(ConfigKey.KEY_AMBULANCE_AGENT_NAME, datas[1]);
config.setValue(ConfigKey.KEY_AMBULANCE_STATION_NAME, datas[1]);
config.setValue(ConfigKey.KEY_FIRE_AGENT_COUNT, datas[2]);
config.setValue(ConfigKey.KEY_FIRE_STATION_COUNT, datas[3]);
config.setValue(ConfigKey.KEY_POLICE_AGENT_COUNT, datas[4]);
config.setValue(ConfigKey.KEY_POLICE_STATION_COUNT, datas[5]);
config.setValue(ConfigKey.KEY_AMBULANCE_AGENT_COUNT, datas[6]);
config.setValue(ConfigKey.KEY_AMBULANCE_STATION_COUNT, datas[7]);
}
}
示例5: getConfig
import rescuecore2.config.Config; //导入依赖的package包/类
public static Config getConfig(File configPath, String[] args) {
Config commandLine = analysis(args);
//File configDir = new File(System.getProperty("user.dir"), "config");
if (!configPath.exists()) {
if(!configPath.mkdir()) {
return commandLine;
}
}
try {
Config config = new Config(configPath);
config.merge(commandLine);
return config;
} catch (ConfigException e) {
e.printStackTrace();
}
return commandLine;
}
示例6: connect
import rescuecore2.config.Config; //导入依赖的package包/类
private static void connect(ComponentLauncher launcher, Config config, MrlViewer mrlViewer) throws InterruptedException, ConnectionException {
try {
Logger.info("Connecting viewer ...");
launcher.connect(mrlViewer);
mrlViewer.getViewerPanel().getLayers();
Logger.info("success");
} catch (ComponentConnectionException e) {
Logger.info("failed: " + e.getMessage());
}
}
示例7: initialise
import rescuecore2.config.Config; //导入依赖的package包/类
@Override
public void initialise(Config c) {
super.initialise(c);
this.config = c;
for (ViewLayer next : layers) {
com.mrl.debugger.ViewLayer annotation = next.getClass().getAnnotation(com.mrl.debugger.ViewLayer.class);
String visibleKey = STANDARD_VIEWER_PREFIX + "." + next.getClass().getSimpleName() + "." + VISIBILITY_SUFFIX;
if (annotation != null) {
config.setBooleanValue(visibleKey, annotation.visible());
}
next.initialise(config);
}
}
示例8: initialise
import rescuecore2.config.Config; //导入依赖的package包/类
@Override
public void initialise(Config config) {
super.initialise(config);
humanIDs.clear();
synchronized (this) {
frames.clear();
animationDone = true;
}
}
示例9: initialise
import rescuecore2.config.Config; //导入依赖的package包/类
@Override
public void initialise(Config config) {
iconSize = config.getIntValue(MrlConstants.ICON_SIZE_KEY, DEFAULT_ICON_SIZE);
useIcons = config.getBooleanValue(MrlConstants.USE_ICONS_KEY, false);
SAY_RANGE = config.getIntValue(MrlConstants.VOICE_RANGE_KEY);
VIEW_RANGE = config.getIntValue(MrlConstants.MAX_VIEW_DISTANCE_KEY);
CLEAR_RANGE = config.getIntValue(MrlConstants.MAX_CLEAR_DISTANCE_KEY);
EXTINGUISH_RANGE = config.getIntValue(MrlConstants.MAX_EXTINGUISH_DISTANCE_KEY);
icons = new HashMap<String, Map<State, Icon>>();
icons.put(StandardEntityURN.FIRE_BRIGADE.toString(), generateIconMap("FireBrigade"));
icons.put(StandardEntityURN.AMBULANCE_TEAM.toString(), generateIconMap("AmbulanceTeam"));
icons.put(StandardEntityURN.POLICE_FORCE.toString(), generateIconMap("PoliceForce"));
icons.put(StandardEntityURN.CIVILIAN.toString() + "-Male", generateIconMap("Civilian-Male"));
icons.put(StandardEntityURN.CIVILIAN.toString() + "-Female", generateIconMap("Civilian-Female"));
useIconsAction = new UseIconsAction();
atInfo = false;
atInfoAction = new RenderATInfoAction();
pfInfo = false;
pfInfoAction = new RenderPFInfoAction();
fbInfo = false;
fbInfoAction = new RenderFBInfoAction();
civInfo = false;
civInfoAction = new RenderCivInfoAction();
sayRange = false;
sayRangeAction = new SayRangeAction();
viewRange = false;
viewRangeAction = new ViewRangeAction();
clearRange = false;
clearRangeAction = new ClearRangeAction();
agentSize = false;
agentSizeAction = new AgentSizeAction();
extinguishRange = false;
extinguishRangeAction = new ExtinguishRangeAction();
agentLocation = true;
agentLocationAction = new AgentLocationAction();
}
示例10: preparation
import rescuecore2.config.Config; //导入依赖的package包/类
@Override
public void preparation(Config config, MessageManager messageManager) {
this.routeSearcher = new SampleRouteSearcher(this, new RouteManager(this.world));
this.impassableSelector = new SampleImpassableSelector(this);
//Police
this.agentPoint = new Point2D[2];
this.beforeMove = false;
this.neighbourEdgesMap = new HashMap<>();
this.passablePointMap = new HashMap<>();
this.clearListMap = new HashMap<>();
this.beforeMove = false;
this.count = -1;
}
示例11: Reservoir
import rescuecore2.config.Config; //导入依赖的package包/类
private Reservoir(Refuge station, StandardWorldModel world, Config config) {
//this.refuge = station;
this.area = station;
this.id = station.getID();
this.supply = config.getIntValue(KEY_REFILL_REFUGE, 500);
this.location = station.getLocation(world);
}
示例12: getInstance
import rescuecore2.config.Config; //导入依赖的package包/类
public static Reservoir getInstance(StandardEntity station, StandardWorldModel world, Config config) {
if(station == null) {
return null;
}
if(station instanceof Refuge) {
return new Reservoir((Refuge)station, world, config);
}
if(station instanceof Hydrant) {
return new Reservoir((Hydrant)station, world, config);
}
return null;
}
示例13: ReservoirSelector
import rescuecore2.config.Config; //导入依赖的package包/类
public ReservoirSelector(StandardWorldModel standardWorldModel, Config c, RouteSearcherProvider routeSearcherProvider, int operationCount) {
this.world = standardWorldModel;
this.config = c;
this.provider = routeSearcherProvider;
this.averageDistance = DEFAULT_AVERAGE;
this.firstUpdate = true;
this.count = operationCount;
this.initList();
}
示例14: setValue
import rescuecore2.config.Config; //导入依赖的package包/类
@Override
public void setValue(Config config, String[] datas) {
if (datas.length == 3) {
config.setValue(Constants.KERNEL_HOST_NAME_KEY, datas[1]);
config.setValue(Constants.KERNEL_PORT_NUMBER_KEY, datas[2]);
}
}
示例15: analysis
import rescuecore2.config.Config; //导入依赖的package包/类
public static Config analysis(String[] args) {
Config config = new Config();
Map<String, Option> options = initOption();
for(String str : args) {
String[] strArray = str.split(":");
Option option = options.get(strArray[0]);
if(option != null) {
option.setValue(config, strArray);
}
}
return config;
}