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);
        }
    }
}
