#pragma once

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

struct game {
	game(int argc, char* argv[]);

	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;
	int _argc;
	char** _argv;
	audio* _audio;
};

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