Package cn.com.hotmaze.util

Examples of cn.com.hotmaze.util.XMLdoc


   
    private static MapContext single; 
   
    private void init(){
      System.out.println("�������е�ͼ");
      XMLdoc doc = new XMLdoc("res/map/map_list.xml");
      doc.openXML();
      Element root = doc.getRootElement();
      for(Iterator<?> itr = root.elementIterator();itr.hasNext();){
        Element em = (Element) itr.next();
        Attribute index = em.attribute("map_name");
        System.out.println("�����ͼ "+index.getValue()+".....");
        RoomMap map = new RoomMap("res/map/"+index.getValue()+".xml");
        MapContext.map.putIfAbsent(index.getValue(),map);
      }
      doc.closeXML();
    }
View Full Code Here


   
    private static TriggerContext single; 
   
    private void init(){
      System.out.println("�������");
      XMLdoc doc = new XMLdoc("res/map/all_trigger.xml");
      doc.openXML();
      Element root = doc.getRootElement();
      for(Iterator<?> itr = root.elementIterator();itr.hasNext();){
        Element em = (Element) itr.next();
        String id = em.attributeValue("id");
        int type = Integer.valueOf(em.attributeValue("type"));
        String mapping_id = em.attributeValue("mapping");
        int cd = Integer.valueOf(em.attributeValue("cd"));
        TriggerBase trigger = TriggerFactory.createTrigger(id);
        trigger.setCd(cd);
        trigger.setMappingId(mapping_id);
        trigger.setType(type);
        for (Iterator itrChild = em.elementIterator(); itrChild.hasNext();) {
          Element el = (Element) itrChild.next();
          String offset = el.attributeValue("action_offset");
          System.out.println(offset);
          trigger.addActionPoint(offset);
        }
       
        TriggerContext.map.putIfAbsent(id, trigger);
       
      }
      doc.closeXML();
    }
View Full Code Here

TOP

Related Classes of cn.com.hotmaze.util.XMLdoc

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.