Package fr.formiko.usuel
Class Folder
java.lang.Object
fr.formiko.usuel.Folder
Class that have all link to all folder of formiko.
You can acces to file by using getters. Ex : getFolderStable()+getFolderImages() will return the path to stable images.
You can acces to file by using getters. Ex : getFolderStable()+getFolderImages() will return the path to stable images.
- Author:
- Hydrolien
-
Field Summary
Modifier and TypeFieldDescriptionprivate static String
private String
private String
private String
private String
private String
private String
private String
private String
private String
private String
private String
private String
private String
private boolean
private int
private static boolean
private boolean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Delete all unnecesary folders and files.void
Download main data from github release.void
Download music data from github release.Return the curent data version that game have.Return the curent music version that game have.Return the version that game have.Return the last stable version downloadable on the web site.static Path
return the path to version.json.static Path
return the path to version.md.static Path
getVersionPath(String fileName)
return the path to version.x.Return the data version that game want to have.Return the music version that game want to have.getXVersion(Path pathToJson, String nameOfTheVersion)
Return the version from path & name of the wanted version.int
ini()
int
ini(boolean allowedDownolad)
Initialize missing folder if some folder are missing.void
void
iniFolderMain(Os os)
Initialize the main folder name depending of OS.private void
Initialize resourcesPacks missing folder.private void
iniStable(boolean allowedDownolad)
Initialize stable missing folder.private void
Initialize temporary missing folder.boolean
Return true if v1 > v2.boolean
Return true if data version is outdated or overdated.boolean
Return true if a new version is aviable.private void
Do pre download action.void
setFolderBin(String folderBin)
void
setFolderImages(String folderImages)
void
setFolderLanguages(String folderLanguages)
void
setFolderLevels(String folderLevels)
void
void
setFolderMain(String folderMain)
void
setFolderMaps(String folderMaps)
void
setFolderMusiques(String folderMusiques)
void
setFolderResourcesPacks(String folderResourcesPacks)
void
setFolderSaves(String folderSaves)
void
setFolderSounds(String folderSounds)
void
setFolderStable(String folderStable)
void
setFolderTemporary(String folderTemporary)
void
setFolderVideos(String folderVideos)
void
setLaunchDownload(boolean b)
private boolean
Do post download action.
-
Field Details
-
DEFAULT_NULL_VERSION
-
folderMain
-
folderStable
-
folderTemporary
-
folderResourcesPacks
-
folderSaves
-
folderBin
-
folderImages
-
folderSounds
-
folderMusiques
-
folderMaps
-
folderLanguages
-
folderLevels
-
folderVideos
-
missingFolder
private int missingFolder -
secondTime
private boolean secondTime -
launchDownload
private boolean launchDownload -
newVersionAviableTestDone
private static boolean newVersionAviableTestDone
-
-
Constructor Details
-
Folder
public Folder()
-
-
Method Details
-
getFolderMain
-
setFolderMain
-
setFolderMain
public void setFolderMain() -
getFolderStable
-
setFolderStable
-
getFolderTemporary
-
setFolderTemporary
-
getFolderResourcesPacks
-
setFolderResourcesPacks
-
getFolderSaves
-
setFolderSaves
-
getFolderBin
-
setFolderBin
-
getFolderImages
-
setFolderImages
-
getFolderSounds
-
setFolderSounds
-
getFolderMusiques
-
setFolderMusiques
-
getFolderMaps
-
setFolderMaps
-
getFolderLanguages
-
setFolderLanguages
-
getFolderLevels
-
setFolderLevels
-
getFolderVideos
-
setFolderVideos
-
setLaunchDownload
public void setLaunchDownload(boolean b) -
iniFolderMain
Initialize the main folder name depending of OS.- Parameters:
os
- Os to use for name initialisation.
-
iniFolderMain
public void iniFolderMain() -
ini
public int ini(boolean allowedDownolad)Initialize missing folder if some folder are missing.
It will call download if main folder is missing.
It will send an info if some were missing and an error if some unfixable folder were missing.- Parameters:
allowedDownolad
- true if we can download files.
-
ini
public int ini() -
cleanFolder
public void cleanFolder()Delete all unnecesary folders and files. -
iniStable
private void iniStable(boolean allowedDownolad)Initialize stable missing folder.- Parameters:
allowedDownolad
- true if we can download files.
-
iniTemporary
private void iniTemporary()Initialize temporary missing folder. -
iniRessourcesPacks
private void iniRessourcesPacks()Initialize resourcesPacks missing folder. -
downloadData
public void downloadData()Download main data from github release.
It need Main.version to be correct to work. -
prepareDownloadData
private void prepareDownloadData()Do pre download action. -
unzipAndCleanDownloadData
private boolean unzipAndCleanDownloadData()Do post download action. -
needToUpdateDataVersion
public boolean needToUpdateDataVersion()Return true if data version is outdated or overdated.
Each game version have 1 linked data version, so we need to know witch one. Data don't need to be update as many times as game is, so when a new version of data is needed it is publish in github action. A new data version always take curent game version as version number. -
newVersionAviable
public boolean newVersionAviable()Return true if a new version is aviable.
If last stable version > curent version. -
isOver
Return true if v1 > v2. -
getCurentVersion
Return the version that game have. -
getCurentDataVersion
Return the curent data version that game have. -
getCurentMusicVersion
Return the curent music version that game have. -
getWantedDataVersion
Return the data version that game want to have. -
getWantedMusicVersion
Return the music version that game want to have. -
getLastStableVersion
Return the last stable version downloadable on the web site. -
getXVersion
Return the version from path & name of the wanted version.
If it fail, it will return a defaut version.- Parameters:
pathToJson
- path to the .json file taht containt versionnameOfTheVersion
- name of the version- Returns:
- a version String as 1.49.12
-
getVersionPath
return the path to version.x. -
getVersionMdPath
return the path to version.md.
Curent version is in version.md. -
getVersionJsonPath
return the path to version.json. -
downloadMusicData
public void downloadMusicData()Download music data from github release.
It need Main.version to be correct to work.
-