/*
 * Controls.h
 *
 *  Created on: 2009-07-10
 *      Author: wasyl
 */

#ifndef CONTROLS_H_
#define CONTROLS_H_

#include <allegro5/allegro.h>
#include "../prep/input/Switch.h"
#include "../prep/input/Primaries.h"

class Controls
{
public:
	Switch *up, *down, *left, *right, *jump, *action, *space, *click, *quit, *restart;
	static Controls *controls;

private:
	Controls()
	{
		up = new Key(ALLEGRO_KEY_UP);
		down = new Key(ALLEGRO_KEY_DOWN);
		left = new Key(ALLEGRO_KEY_LEFT);
		right = new Key(ALLEGRO_KEY_RIGHT);
		jump = new OnPress(new Key(ALLEGRO_KEY_Z));
		action = new OnPress(new Key(ALLEGRO_KEY_X));
		space = new OnPress(new Key(ALLEGRO_KEY_SPACE));
		click = new OnPress(new MouseKey(MouseKey::LEFT));
		quit = new OnPress(new Key(ALLEGRO_KEY_ESCAPE));
		restart = new OnPress(new Key(ALLEGRO_KEY_R));
	}

public:
	static Controls &get()
	{
		if (!controls)
			controls = new Controls();
		return *controls;
	}
};

#endif /* CONTROLS_H_ */
