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
FieldsModifier and TypeFieldDescriptionprivate static Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate booleanprivate intprivate static booleanprivate boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDelete all unnecesary folders and files.voidDownload main data from github release.voidDownload 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 Pathreturn the path to version.json.static Pathreturn the path to version.md.static PathgetVersionPath(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.intini()intini(boolean allowedDownolad)Initialize missing folder if some folder are missing.voidvoidiniFolderMain(Os os)Initialize the main folder name depending of OS.private voidInitialize resourcesPacks missing folder.private voidiniStable(boolean allowedDownolad)Initialize stable missing folder.private voidInitialize temporary missing folder.booleanReturn true if v1 > v2.booleanReturn true if data version is outdated or overdated.booleanReturn true if a new version is aviable.private voidDo pre download action.voidsetFolderBin(String folderBin)voidsetFolderImages(String folderImages)voidsetFolderLanguages(String folderLanguages)voidsetFolderLevels(String folderLevels)voidvoidsetFolderMain(String folderMain)voidsetFolderMaps(String folderMaps)voidsetFolderMusiques(String folderMusiques)voidsetFolderResourcesPacks(String folderResourcesPacks)voidsetFolderSaves(String folderSaves)voidsetFolderSounds(String folderSounds)voidsetFolderStable(String folderStable)voidsetFolderTemporary(String folderTemporary)voidsetFolderVideos(String folderVideos)voidsetLaunchDownload(boolean b)private booleanDo 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.
-