Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public String copyMap(int teams, int maxPlayersPerTeam){
- String type = teams + "x" + maxPlayersPerTeam;
- File baseDir = new File(dir);
- //8x1_mapname
- List<File> files = new ArrayList<File>();
- for(File f : baseDir.listFiles()){
- if(f.isDirectory()){
- if(f.getName().startsWith(type)){
- files.add(f);
- }
- }
- }
- File mapFile = files.get(new Random().nextInt(files.size()));
- String MapName = mapFile.getName().split("_")[1];
- //TODO CopyMap
- return mapName;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement