package model;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.Timer;

import main.Window;

public class GameModel implements ActionListener {

	private Timer t;
	private GameStateManager gsm;

	public GameModel(GameStateManager gsm) {
		this.gsm = gsm;

		// Start the update timer
		t = new Timer(1000 / Window.UPDATES_PER_SECOND, this);
		t.start();
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		gsm.update();
	}
}
