#pragma once

#include "image.h"
#include "settings.h"
#include "resource_manager.h"

struct game {
	game();

	void run();
	virtual void init(settings& settings);
	virtual void render(image& target);
	virtual void update();
protected:
	vec2i const& mouse_pos() const;
	void cursor(image const* cursor);
	template<typename T>
	T const* get(std::string const& path);
	int fps();
private:
	vec2i _mouse_pos;
	image const* _cursor;
	resource_manager _rm;
	int _fps;
};

template<typename T>
inline T const* game::get(std::string const& path) {
	return _rm.get<T>(path);
}
