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 long
Date of 1a lauch.private long
Date of last lauch.private long
Time played. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addTempsEnJeux(long x)
static void
static void
affDateDuJour(String format)
Print current date.void
Load all time informations save in Temps.txt.long
getDate1()
long
getDate2()
static String
return current date + current hours.long
static void
Initialize time file.static String
msToS(int x)
static String
msToS(long x)
Transform ms to s.static String
msToTime(long ms)
static String
msToTime(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 void
pause(int ms)
Try to stop execution of the programme during some ms.static void
Try to stop execution of the thread during some ms.void
Save time information in Temps.txt.void
setDate1(long x)
void
setDate2(long x)
void
setTempsEnJeux(long x)
static void
sleep()
Try to stop execution of the programme during 50 ms.static void
sleep(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()
-