/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI.game;

import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Dániel
 */
public class StopWatch extends Thread
{
    private Controller controller;
    private int time;
    
    public StopWatch(Controller controller)
    {
        this.controller  = controller;
    }
    
    @Override
    public void run()
    {
        synchronized(this.controller)
        {
            while( true )
            {            
                try 
                {

                    controller.timeLeft();
                    sleep(1000);
                } catch (InterruptedException ex) 
                {
                    System.out.println("int error");
                }
            }
        }
    }
}