
package fortuna.entropySources;

/**
 *
 * @author Viliam Krizan
 */


import fortuna.acumulator.Acumulator;



public abstract class EntropySource implements Runnable{
    
    protected Acumulator acumulator;
    protected int actualPool = 0;
    protected volatile boolean running;
    
    public EntropySource(){
        
    }
    
    public void passAcumulatorToES(Acumulator acumulator){
        this.acumulator = acumulator;
    }
    
    @Override
    public void run() {
        running = true;
    }
    
    protected void poolCounterIncrement(){
        if(actualPool == 31){
            actualPool = 0;
            } else{
                actualPool++;
        }
    }
    
    public void stopRunning(){
        running = false;
    }
}
