package MyCanvas.GameCanvas;
import java.util.concurrent.locks.*;

public class CpLock {

	
	public static ReentrantLock timerLock;
	public ReentrantLock turnLock;
	public ReentrantLock enemyLock;
	
	public boolean isTurn;
	
	public CpLock(){
	
		timerLock = new ReentrantLock();
		turnLock = new ReentrantLock();
		enemyLock = new ReentrantLock();
		
		isTurn = false;
	}
	
	public void setIsTurn(){
		turnLock.lock();
		isTurn = true;
		turnLock.unlock();
	}
	public void resetIsTurn(){
		turnLock.lock();
		isTurn = false;
		turnLock.unlock();	
	}
	public boolean getIsTurn(){
		boolean x;
		turnLock.lock();
		x = isTurn;
		turnLock.unlock();
		return x;
	}
}
