-
Notifications
You must be signed in to change notification settings - Fork 2
Reduce boilerplate required to load resources. #28
Copy link
Copy link
Open
Labels
Description
Currently to load vanguard/boot.lua we have to perform this song and dance:
const Resource::Type *script_resource_type = resource_manager::type_from_name("script");
const Resource::Type::Id script_resource_type_id = resource_manager::id_from_type(script_resource_type);
const Resource::Id script_resource_id = Resource::id_from_type_and_name(script_resource_type_id, "vanguard/boot");
ScriptResource *script_resource = (ScriptResource *)resource_manager::load(script_resource_id);
while (script_resource->state() != Resource::LOADED);We should simplify it to something like:
ScriptResource *script_resource = resource_manager::load<ScriptResource *>("vanguard/boot");
while (script_resource->state() != Resource::LOADED);Reactions are currently unavailable