namespace Components { class AssetHandler : public Component { public: typedef Game::XAssetHeader(*Callback)(Game::XAssetType, const char*); typedef bool(*RestrictCallback)(Game::XAssetType type, Game::XAssetHeader asset, const char* name); AssetHandler(); ~AssetHandler(); const char* GetName() { return "AssetHandler"; }; static void OnFind(Game::XAssetType type, Callback callback); static void OnLoad(RestrictCallback callback); static const bool Restrict; static const bool Load; private: static bool BypassState; static Game::XAssetHeader FindAsset(Game::XAssetType type, const char* filename); static bool IsAssetEligible(Game::XAssetType type, Game::XAssetHeader* asset); static void FindAssetStub(); static void AddAssetStub(); static std::map TypeCallbacks; static std::vector RestrictCallbacks; }; }