project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Scheme.java
changeset 6725 f5eb11306c6a
parent 6700 e04da46ee43c
child 6844 69fb04c8a841
equal deleted inserted replaced
6724:03cd33624284 6725:f5eb11306c6a
    44 	private String name;
    44 	private String name;
    45 	//private ArrayList<Integer> basic;
    45 	//private ArrayList<Integer> basic;
    46 	private Integer gamemod;
    46 	private Integer gamemod;
    47 	private ArrayList<Integer> basic;;
    47 	private ArrayList<Integer> basic;;
    48 	private static ArrayList<LinkedHashMap<String, ?>> basicflags = new ArrayList<LinkedHashMap<String, ?>>();//TODO why is it static?
    48 	private static ArrayList<LinkedHashMap<String, ?>> basicflags = new ArrayList<LinkedHashMap<String, ?>>();//TODO why is it static?
       
    49 	public int health;
    49 	
    50 	
    50 	public Scheme(String _name, ArrayList<Integer> _basic, int _gamemod){
    51 	public Scheme(String _name, ArrayList<Integer> _basic, int _gamemod){
    51 		name = _name;
    52 		name = _name;
    52 		gamemod = _gamemod;
    53 		gamemod = _gamemod;
    53 		basic = _basic;
    54 		basic = _basic;
    63 		for(int pos = 0; pos < basic.size(); pos++){
    64 		for(int pos = 0; pos < basic.size(); pos++){
    64 			LinkedHashMap<String, ?> basicflag = basicflags.get(pos);
    65 			LinkedHashMap<String, ?> basicflag = basicflags.get(pos);
    65 			
    66 			
    66 			String command = (String)basicflag.get("command");
    67 			String command = (String)basicflag.get("command");
    67 			Integer value = basic.get(pos);
    68 			Integer value = basic.get(pos);
       
    69 			
       
    70 			if(command.equals("inithealth")){//Health is a special case, it doesn't need to be send 				                             
       
    71 				health = value;              //to the engine yet, we'll do that with the other HH info
       
    72 				continue;
       
    73 			}
       
    74 			
    68 			Boolean checkOverMax = (Boolean) basicflag.get("checkOverMax");
    75 			Boolean checkOverMax = (Boolean) basicflag.get("checkOverMax");
    69 			Boolean times1000 = (Boolean) basicflag.get("times1000");
    76 			Boolean times1000 = (Boolean) basicflag.get("times1000");
    70 			Integer max = (Integer) basicflag.get("max");
    77 			Integer max = (Integer) basicflag.get("max");
    71 			
    78 			
    72 			if(checkOverMax && value >= max) value = max;
    79 			if(checkOverMax && value >= max) value = max;
   104 				BufferedReader br = new BufferedReader(new FileReader(dir + file), 1024);
   111 				BufferedReader br = new BufferedReader(new FileReader(dir + file), 1024);
   105 				xmlPuller.setInput(br);
   112 				xmlPuller.setInput(br);
   106 				String name = null;
   113 				String name = null;
   107 				ArrayList<Integer> basic = new ArrayList<Integer>();
   114 				ArrayList<Integer> basic = new ArrayList<Integer>();
   108 				Integer gamemod = 0;
   115 				Integer gamemod = 0;
       
   116 				int health = 0;
   109 				int mask = 0x000000004;
   117 				int mask = 0x000000004;
   110 
   118 
   111 				int eventType = xmlPuller.getEventType();
   119 				int eventType = xmlPuller.getEventType();
   112 				int state = STATE_START;
   120 				int state = STATE_START;
   113 				while(eventType != XmlPullParser.END_DOCUMENT){
   121 				while(eventType != XmlPullParser.END_DOCUMENT){