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 Summary
FieldsModifier and TypeFieldDescriptionprivate longDate of 1a lauch.private longDate of last lauch.private longTime played. -
Constructor Summary
Constructors -
Method Summary
Modifier 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
-
date1
private long date1Date of 1a lauch. -
date2
private long date2Date of last lauch. -
tempsEnJeux
private long tempsEnJeuxTime played.
-
-
Constructor Details
-
Temps
public Temps()DateFormat.
-
-
Method Details
-
getDate1
public long getDate1() -
setDate1
public void setDate1(long x) -
getDate2
public long getDate2() -
setDate2
public void setDate2(long x) -
actualiserDate2
public void actualiserDate2() -
getTempsEnJeux
public long getTempsEnJeux() -
setTempsEnJeux
public void setTempsEnJeux(long x) -
addTempsEnJeux
public void addTempsEnJeux(long x) -
toString
Return a string representing time as in Options date format. -
chargerTemps
public void chargerTemps()Load all time informations save in Temps.txt. -
sauvegarder
public void sauvegarder()Save time information in Temps.txt. -
msToTime
return 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
-
msToTimeLongArray
public 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.
-
getDatePourSauvegarde
return current date + current hours. -
initialiserFichierTemps
public static void initialiserFichierTemps()Initialize time file. -
sleep
public static void sleep(int ms)Try to stop execution of the programme during some ms.- Parameters:
ms- number of ms to wait before continue.
-
sleep
public static void sleep()Try to stop execution of the programme during 50 ms. -
pause
public static void pause(int ms)Try to stop execution of the programme during some ms.- Parameters:
ms- number of ms to wait before continue.
-
pause
Try to stop execution of the thread during some ms.- Parameters:
ms- number of ms to wait before continue.th- the thread to stop.
-
msToS
-
msToS
Transform ms to s. -
affDateDuJour
Print current date. -
affDateDuJour
public static void affDateDuJour()
-