Skip to content

Commit

Permalink
Add SceneBase::load_arg_count
Browse files Browse the repository at this point in the history
  • Loading branch information
Kazade committed Jan 8, 2022
1 parent f16c1de commit e3f110f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions simulant/scenes/scene.cpp
Expand Up @@ -57,6 +57,10 @@ void SceneBase::_fixed_update_thunk(float dt) {
fixed_update(dt);
}

std::size_t SceneBase::load_arg_count() const {
return load_args.size();
}


void SceneBase::_call_load() {
if(is_loaded_) {
Expand Down
3 changes: 3 additions & 0 deletions simulant/scenes/scene.h
Expand Up @@ -144,6 +144,9 @@ class SceneBase:
std::vector<any> load_args;

protected:
/* Returns the number of arguments passed when loading */
std::size_t load_arg_count() const;

template<typename T>
T get_load_arg(int i) {
return any_cast<T>(load_args[i]);
Expand Down

0 comments on commit e3f110f

Please sign in to comment.