iMackshun

TimeManager.java

Jul 4th, 2015
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.81 KB | None | 0 0
  1. package com.iMackshun.Games.SoulBlazeRPG.Objects;
  2.  
  3. import com.badlogic.gdx.Gdx;
  4. import com.iMackshun.Games.SoulBlazeRPG.SoulBlazeRPG;
  5.  
  6. public class TimeManager {
  7.     //Object Properties
  8.     private int Digit1;
  9.     private int Digit2;
  10.     private int Digit3;
  11.     private int Digit4;
  12.     private int Digit5;
  13.     private int Digit6;
  14.     private float TimeElapsed;
  15.     //Constructor
  16.     public TimeManager(){
  17.         Digit1 = 0;
  18.         Digit2 = 0;
  19.         Digit3 = 0;
  20.         Digit4 = 0;
  21.         Digit5 = 0;
  22.         Digit6 = 0;
  23.     }
  24.     //Personal Methods
  25.     public void update(float delta){
  26.         TimeElapsed += delta;
  27.         if(TimeElapsed >= 1){
  28.             //A second has passed...
  29.             Gdx.app.log(SoulBlazeRPG.LOG, "A second has passed...");
  30.             Digit1++;
  31.             TimeElapsed = 0;
  32.         }
  33.         if(Digit1 >= 10){
  34.             Digit2++;
  35.             Digit1 = 0;
  36.         }
  37.         if(Digit2 >= 6){
  38.             Digit3++;
  39.             Digit2 = 0;
  40.         }
  41.         if(Digit3 >= 10){
  42.             Digit4++;
  43.             Digit3 = 0;
  44.         }
  45.         if(Digit4 >= 6){
  46.             Digit5++;
  47.             Digit4 = 0;
  48.         }
  49.         if(Digit5 >= 10){
  50.             Digit6++;
  51.             Digit5 = 0;
  52.         }
  53.         if(Digit6 >= 10){
  54.             //Wow...you really play this game too much...
  55.             Gdx.app.log(SoulBlazeRPG.LOG, "Wow, you really play this game too much...");
  56.         }
  57.     }
  58.     //Getters and Setters
  59.     public int getDigit1() {
  60.         return Digit1;
  61.     }
  62.     public int getDigit2() {
  63.         return Digit2;
  64.     }
  65.     public int getDigit3() {
  66.         return Digit3;
  67.     }
  68.     public int getDigit4() {
  69.         return Digit4;
  70.     }
  71.     public int getDigit5() {
  72.         return Digit5;
  73.     }
  74.     public int getDigit6() {
  75.         return Digit6;
  76.     }
  77.     public void setDigit1(int digit1) {
  78.         Digit1 = digit1;
  79.     }
  80.     public void setDigit2(int digit2) {
  81.         Digit2 = digit2;
  82.     }
  83.     public void setDigit3(int digit3) {
  84.         Digit3 = digit3;
  85.     }
  86.     public void setDigit4(int digit4) {
  87.         Digit4 = digit4;
  88.     }
  89.     public void setDigit5(int digit5) {
  90.         Digit5 = digit5;
  91.     }
  92.     public void setDigit6(int digit6) {
  93.         Digit6 = digit6;
  94.     }
  95.    
  96. }
Advertisement
Add Comment
Please, Sign In to add comment