#pragma once

#include <iostream>
#include <vector>
#include <map>
#include <raylib.h>
#include <variant>

namespace Morault {
	namespace Resources {

		typedef enum {
			GET,
			LOAD,
			UNLOAD,
			RELOAD
		} _ResourceRequestType;

		struct _ResourceRequest { // to use as std::get<Model>(Models(get("test.obj")));
			_ResourceRequestType type;
			std::string req;
		};

		_ResourceRequest load(std::string resourceName);
		_ResourceRequest get(std::string resourceName);
		_ResourceRequest unload(std::string resourceName);
		_ResourceRequest reload(std::string resourceName);

		std::variant<Model, bool> Models(_ResourceRequest request);

		std::variant<Texture2D, bool> Textures(_ResourceRequest request);


		typedef enum {
			INVALID, IWAD, PWAD
		} WADType;
		struct Lump {
			std::string name, data;
		};

		class WAD {
			std::vector<Lump> lumps;
		public:
			bool loaded = false;
			WADType wadType;
			int lumpCount;
			WAD();
			WAD(std::string path);
			void LoadWAD(std::string path);
			std::vector<Lump> getLumps() {
				return lumps;
			}
			~WAD();
		};
		Image GenTestImage();
	}
}