Package fr.formiko.usuel
Class Temps
java.lang.Object
fr.formiko.usuel.Temps
Time information about game.
It contain date of 1a launch. Date of last launch and time played.
It contain date of 1a launch. Date of last launch and time played.
- Author:
- Hydrolien
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate longDate of 1a lauch.private longDate of last lauch.private longTime played.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidvoidaddTempsEnJeux(long x)static voidstatic voidaffDateDuJour(String format)Print current date.voidLoad all time informations save in Temps.txt.longgetDate1()longgetDate2()static Stringreturn current date + current hours.longstatic voidInitialize time file.static StringmsToS(int x)static StringmsToS(long x)Transform ms to s.static StringmsToTime(long ms)static StringmsToTime(long ms, int nbrOfUnit, boolean dayOn)return time with as specify number of unit.static long[]msToTimeLongArray(long ms, boolean dayOn)return time on a long [].static voidpause(int ms)Try to stop execution of the programme during some ms.static voidTry to stop execution of the thread during some ms.voidSave time information in Temps.txt.voidsetDate1(long x)voidsetDate2(long x)voidsetTempsEnJeux(long x)static voidsleep()Try to stop execution of the programme during 50 ms.static voidsleep(int ms)Try to stop execution of the programme during some ms.toString()Return a string representing time as in Options date format.
- 
Field Details- 
date1private long date1Date of 1a lauch.
- 
date2private long date2Date of last lauch.
- 
tempsEnJeuxprivate long tempsEnJeuxTime played.
 
- 
- 
Constructor Details- 
Tempspublic Temps()DateFormat.
 
- 
- 
Method Details- 
getDate1public long getDate1()
- 
setDate1public void setDate1(long x)
- 
getDate2public long getDate2()
- 
setDate2public void setDate2(long x)
- 
actualiserDate2public void actualiserDate2()
- 
getTempsEnJeuxpublic long getTempsEnJeux()
- 
setTempsEnJeuxpublic void setTempsEnJeux(long x)
- 
addTempsEnJeuxpublic void addTempsEnJeux(long x)
- 
toStringReturn a string representing time as in Options date format.
- 
chargerTempspublic void chargerTemps()Load all time informations save in Temps.txt.
- 
sauvegarderpublic void sauvegarder()Save time information in Temps.txt.
- 
msToTimereturn time with as specify number of unit.
 If language file is not initialize, it will use french letter: 3j 23h 59min 10,1267s- Parameters:
- ms- times in ms.
- nbrOfUnit- number of units to include in the return string.
- dayOn- enable or disable day as a unit.
 
- 
msToTime
- 
msToTimeLongArraypublic static long[] msToTimeLongArray(long ms, boolean dayOn)return time on a long [].- Parameters:
- ms- times in ms.
- dayOn- enable or disable day as a unit.
 
- 
getDatePourSauvegardereturn current date + current hours.
- 
initialiserFichierTempspublic static void initialiserFichierTemps()Initialize time file.
- 
sleeppublic static void sleep(int ms)Try to stop execution of the programme during some ms.- Parameters:
- ms- number of ms to wait before continue.
 
- 
sleeppublic static void sleep()Try to stop execution of the programme during 50 ms.
- 
pausepublic static void pause(int ms)Try to stop execution of the programme during some ms.- Parameters:
- ms- number of ms to wait before continue.
 
- 
pauseTry to stop execution of the thread during some ms.- Parameters:
- ms- number of ms to wait before continue.
- th- the thread to stop.
 
- 
msToS
- 
msToSTransform ms to s.
- 
affDateDuJourPrint current date.
- 
affDateDuJourpublic static void affDateDuJour()
 
-