當前位置: 首頁>>代碼示例>>Java>>正文


Java Config類代碼示例

本文整理匯總了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]);
    }
}
 
開發者ID:AIT-Rescue,項目名稱:AIT-Rescue,代碼行數:22,代碼來源:OptionPolice.java

示例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]);
    }
}
 
開發者ID:AIT-Rescue,項目名稱:AIT-Rescue,代碼行數:22,代碼來源:OptionFire.java

示例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]);
    }
}
 
開發者ID:AIT-Rescue,項目名稱:AIT-Rescue,代碼行數:22,代碼來源:OptionAmbulance.java

示例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]);
    }
}
 
開發者ID:AIT-Rescue,項目名稱:AIT-Rescue,代碼行數:21,代碼來源:OptionTeam.java

示例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;
}
 
開發者ID:AIT-Rescue,項目名稱:AIT-Rescue,代碼行數:18,代碼來源:ConfigInitializer.java

示例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());
    }
}
 
開發者ID:MRL-RS,項目名稱:visual-debugger,代碼行數:14,代碼來源:LaunchMRLViewer.java

示例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);
    }
}
 
開發者ID:MRL-RS,項目名稱:visual-debugger,代碼行數:14,代碼來源:MrlLayerViewComponent.java

示例8: initialise

import rescuecore2.config.Config; //導入依賴的package包/類
@Override
public void initialise(Config config) {
    super.initialise(config);
    humanIDs.clear();
    synchronized (this) {
        frames.clear();
        animationDone = true;
    }
}
 
開發者ID:MRL-RS,項目名稱:visual-debugger,代碼行數:10,代碼來源:MrlBaseAnimatedHumanLayer.java

示例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();
}
 
開發者ID:MRL-RS,項目名稱:visual-debugger,代碼行數:40,代碼來源:MrlBaseHumanInfoLayer.java

示例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;
}
 
開發者ID:AIT-Rescue,項目名稱:AIT-Rescue,代碼行數:14,代碼來源:SampleTacticsPolice.java

示例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);
}
 
開發者ID:AIT-Rescue,項目名稱:AIT-Rescue,代碼行數:8,代碼來源:Reservoir.java

示例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;
}
 
開發者ID:AIT-Rescue,項目名稱:AIT-Rescue,代碼行數:13,代碼來源:Reservoir.java

示例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();
}
 
開發者ID:AIT-Rescue,項目名稱:AIT-Rescue,代碼行數:10,代碼來源:ReservoirSelector.java

示例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]);
    }
}
 
開發者ID:AIT-Rescue,項目名稱:AIT-Rescue,代碼行數:8,代碼來源:OptionServer.java

示例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;
}
 
開發者ID:AIT-Rescue,項目名稱:AIT-Rescue,代碼行數:13,代碼來源:ConfigInitializer.java


注:本文中的rescuecore2.config.Config類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。