diff --git a/src/org/geeksoc/guts2014/GameTime.java b/src/org/geeksoc/guts2014/GameTime.java index de261b0..b1952a6 100644 --- a/src/org/geeksoc/guts2014/GameTime.java +++ b/src/org/geeksoc/guts2014/GameTime.java @@ -48,5 +48,9 @@ public static void setSpeed(int s) { public static int getSpeed() { return speed; } + + public static boolean isPaused() { + return speed == 0; + } } diff --git a/src/org/geeksoc/guts2014/Workload.java b/src/org/geeksoc/guts2014/Workload.java index 0123187..89fea0b 100644 --- a/src/org/geeksoc/guts2014/Workload.java +++ b/src/org/geeksoc/guts2014/Workload.java @@ -72,42 +72,46 @@ public void update() { //System.out.println("Socials"); } - if(loop>500){ - System.out.println("Looped"); - if (emails.size()>50){ - Main.rep -= 1; - } - if (phones.size()>50){ - Main.rep -= 1; - } - if (texts.size()>50){ - Main.rep -= 1; - } - if (socials.size()>50){ - Main.rep -= 1; - } - - if (emails.isEmpty()){ - Main.rep += 1; - } - if (phones.isEmpty()){ - Main.rep += 1; - } - if (texts.isEmpty()){ - Main.rep += 1; - } - if (socials.isEmpty()){ - Main.rep += 1; - } - - if (Main.rep<0)Main.rep = 0; - if (Main.rep>100) Main.rep=100; - loop=0; + if (!GameTime.isPaused()) { + if (loop > 500) { + System.out.println("Looped"); + if (emails.size() > 50) { + Main.rep -= 1; + } + if (phones.size() > 50) { + Main.rep -= 1; + } + if (texts.size() > 50) { + Main.rep -= 1; + } + if (socials.size() > 50) { + Main.rep -= 1; + } + + if (emails.isEmpty()) { + Main.rep += 1; + } + if (phones.isEmpty()) { + Main.rep += 1; + } + if (texts.isEmpty()) { + Main.rep += 1; + } + if (socials.isEmpty()) { + Main.rep += 1; + } + + if (Main.rep < 0) + Main.rep = 0; + if (Main.rep > 100) + Main.rep = 100; + loop = 0; + } + // System.out.println(global.getWorkDone().toString()); + global = new WorkPacket(); + + loop++; } - //System.out.println(global.getWorkDone().toString()); - global = new WorkPacket();; - - loop++; } public void submit(WorkPacket wp) {