project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/EngineProtocol/FrontendDataUtils.java
branchhedgeroid
changeset 5603 4e4a579a60af
parent 5534 7f3a391a66fb
child 5621 ea796c83ea47
equal deleted inserted replaced
5601:92a7336043d6 5603:4e4a579a60af
   146 		}
   146 		}
   147 
   147 
   148 		return data;
   148 		return data;
   149 	}
   149 	}
   150 
   150 
   151 	public static ArrayList<HashMap<String, ?>> getTeams(Context c){
   151 	public static ArrayList<HashMap<String, Object>> getTeams(Context c){
   152 		ArrayList<HashMap<String, ?>> ret = new ArrayList<HashMap<String, ?>>();
   152 		ArrayList<HashMap<String, Object>> ret = new ArrayList<HashMap<String, Object>>();
   153 
   153 
   154 		File teamsDir = new File(c.getFilesDir().getAbsolutePath() + '/' + Team.DIRECTORY_TEAMS);
   154 		File teamsDir = new File(c.getFilesDir().getAbsolutePath() + '/' + Team.DIRECTORY_TEAMS);
   155 		File[] teamFileNames = teamsDir.listFiles();
   155 		File[] teamFileNames = teamsDir.listFiles();
   156 		if(teamFileNames != null){
   156 		if(teamFileNames != null){
   157 			for(File s : teamFileNames){
   157 			for(File s : teamFileNames){
   166 
   166 
   167 	public static HashMap<String, Object> teamToHashMap(Team t){
   167 	public static HashMap<String, Object> teamToHashMap(Team t){
   168 		HashMap<String, Object> hashmap = new HashMap<String, Object>();
   168 		HashMap<String, Object> hashmap = new HashMap<String, Object>();
   169 		hashmap.put("team", t);
   169 		hashmap.put("team", t);
   170 		hashmap.put("txt", t.name);
   170 		hashmap.put("txt", t.name);
       
   171 		hashmap.put("color", t.color);
       
   172 		hashmap.put("count", t.hogCount);
   171 		switch(t.levels[0]){
   173 		switch(t.levels[0]){
   172 		case 0:
   174 		case 0:
   173 			hashmap.put("img", R.drawable.human);
   175 			hashmap.put("img", R.drawable.human);
   174 			break;
   176 			break;
   175 		case 1:
   177 		case 1: