forked from MagicBane/Server
fatboy
7 months ago
3 changed files with 39 additions and 1 deletions
@ -0,0 +1,24 @@ |
|||||||
|
package engine.workthreads; |
||||||
|
|
||||||
|
import engine.gameManager.PowersManager; |
||||||
|
|
||||||
|
import java.util.ArrayList; |
||||||
|
|
||||||
|
public class PowersThread implements Runnable { |
||||||
|
|
||||||
|
public PowersThread(){ |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void run() { |
||||||
|
while(true){ |
||||||
|
ArrayList<PowersManager.PowerQueObject> purge = new ArrayList<>(); |
||||||
|
for(PowersManager.PowerQueObject pqo : PowersManager.static_power_que){ |
||||||
|
purge.add(pqo); |
||||||
|
PowersManager.usePower(pqo.msg,pqo.origin,pqo.sendCastToSelf); |
||||||
|
} |
||||||
|
PowersManager.static_power_que.removeAll(purge); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue