Class WorkingDirectory
- java.lang.Object
-
- com.bombinggames.wurfelengine.core.WorkingDirectory
-
public class WorkingDirectory extends java.lang.ObjectA class which helps getting OS specific information.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWorkingDirectory.OS
-
Constructor Summary
Constructors Constructor Description WorkingDirectory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voiddelete()Delete the working directory.static booleandeleteDirectory(java.io.File directory)Deletes a directory and all its subfolders.static java.io.FilegetMapsFolder()static WorkingDirectory.OSgetPlatform()static java.io.FilegetWorkingDirectory()Creates the folder.static voidsetApplicationName(java.lang.String applicationName)set a custom name, should be the name of the gamestatic booleanunpackMap(java.lang.String foldername, java.io.InputStream source)unpacks a map to working directory
-
-
-
Method Detail
-
setApplicationName
public static void setApplicationName(java.lang.String applicationName)
set a custom name, should be the name of the game- Parameters:
applicationName- the name of the folder
-
getWorkingDirectory
public static java.io.File getWorkingDirectory()
Creates the folder.- Returns:
- Get the folder where the data is stored.
-
getPlatform
public static WorkingDirectory.OS getPlatform()
- Returns:
- the os
-
getMapsFolder
public static java.io.File getMapsFolder()
- Returns:
- Get the folder where the maps are stored.
- Since:
- 1.2.X
-
unpackMap
public static boolean unpackMap(java.lang.String foldername, java.io.InputStream source)unpacks a map to working directory- Parameters:
foldername- the name of the map folder. Will be created if non existend.source- msut be a zip file without ".foldername" files- Returns:
- trlue if everything went okay
- Since:
- 1.3.13
-
delete
public static void delete()
Delete the working directory. Game should be restarted after that.- Since:
- WE v1.6.4
-
deleteDirectory
public static boolean deleteDirectory(java.io.File directory)
Deletes a directory and all its subfolders.- Parameters:
directory-- Returns:
- Since:
- WE v1.6.4
-
-