Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce boilerplate required to load resources. #28

Open
mtwilliams opened this issue Jun 12, 2016 · 0 comments
Open

Reduce boilerplate required to load resources. #28

mtwilliams opened this issue Jun 12, 2016 · 0 comments

Comments

@mtwilliams
Copy link
Member

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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant