package model.state;

import java.awt.Graphics2D;
import java.awt.event.KeyEvent;

import model.GameStateManager;

public abstract class State {

	protected GameStateManager gsm;

	protected String name;

	// Super class of all the implemented states
	public State(String name, GameStateManager gsm) {
		this.name = name;
		this.gsm = gsm;
	}

	public String getName() {
		return name;
	}

	@Override
	public boolean equals(Object o) {
		if (!(o instanceof State))
			return false;

		State tempstate = (State) o;

		if (tempstate.getName() == this.name)
			return true;
		else
			return false;
	}

	public abstract void init();

	public abstract void exit();

	public abstract void update();

	public abstract void paint(Graphics2D g2);

	public abstract void keyPressed(KeyEvent e);

	public abstract void keyReleased(KeyEvent e);

	public abstract void keyTyped(KeyEvent e);

}
