project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/EngineProtocol/FrontendDataUtils.java
branchhedgeroid
changeset 5534 7f3a391a66fb
parent 5532 3d7ac2b3b703
child 5603 4e4a579a60af
equal deleted inserted replaced
5532:3d7ac2b3b703 5534:7f3a391a66fb
   151 	public static ArrayList<HashMap<String, ?>> getTeams(Context c){
   151 	public static ArrayList<HashMap<String, ?>> getTeams(Context c){
   152 		ArrayList<HashMap<String, ?>> ret = new ArrayList<HashMap<String, ?>>();
   152 		ArrayList<HashMap<String, ?>> ret = new ArrayList<HashMap<String, ?>>();
   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(teamsDir != null){
   156 		if(teamFileNames != null){
   157 			for(File s : teamFileNames){
   157 			for(File s : teamFileNames){
   158 				Team t = Team.getTeamFromXml(s.getAbsolutePath());
   158 				Team t = Team.getTeamFromXml(s.getAbsolutePath());
   159 				if(t != null){
   159 				if(t != null){
   160 					ret.add(teamToHashMap(t));
   160 					ret.add(teamToHashMap(t));
   161 				}
   161 				}