Class Temps

java.lang.Object
fr.formiko.usuel.Temps

public class Temps extends Object
Time information about game.
It contain date of 1a launch. Date of last launch and time played.
Author:
Hydrolien
  • Field Details

    • date1

      private long date1
      Date of 1a lauch.
    • date2

      private long date2
      Date of last lauch.
    • tempsEnJeux

      private long tempsEnJeux
      Time 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

      public String toString()
      Return a string representing time as in Options date format.
      Overrides:
      toString in class Object
    • chargerTemps

      public void chargerTemps()
      Load all time informations save in Temps.txt.
    • sauvegarder

      public void sauvegarder()
      Save time information in Temps.txt.
    • msToTime

      public static String msToTime(long ms, int nbrOfUnit, boolean dayOn)
      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

      public static String msToTime(long ms)
    • 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

      public static String 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

      public static void pause(int ms, Thread th)
      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

      public static String msToS(int x)
    • msToS

      public static String msToS(long x)
      Transform ms to s.
    • affDateDuJour

      public static void affDateDuJour(String format)
      Print current date.
    • affDateDuJour

      public static void affDateDuJour()