11 complexity_total( 0 ),
28 if( this->_blockers.size() )
31 if( !this->_to_load.size() )
36 this->_loading =
true;
37 this->Notify_LoadStart();
41 auto it = this->_to_load.begin();
43 int complexity_bytes = it->second;
44 this->_to_load.erase( it );
52 this->Notify_ItemLoaded( load, complexity_bytes );
55 if( this->_to_load.empty() )
58 this->_loading =
false;
59 this->Notify_LoadFinish();
67 if( this->_loaders.empty() )
73 this->_to_load[ load ] = complexity_bytes;
77 this->Notify_ItemQueued( load, complexity_bytes );
82 this->_to_load.erase( load );
87 this->_loaders.insert( loader );
92 this->_loaders.erase( loader );
93 this->_blockers.erase( loader );
98 if( !this->_loaders.count( loader ) )
102 this->_blockers.insert( loader );
104 this->_blockers.erase( loader );
109 return this->_loading;
112 void DelayedLoadSystem::Notify_LoadStart()
115 this->_loaders.foreach( [&](
DelayedLoader *
const & loader )
121 void DelayedLoadSystem::Notify_LoadFinish()
124 this->_loaders.foreach( [&]( DelayedLoader *
const & loader )
126 loader->LoadFinish();
130 void DelayedLoadSystem::Notify_ItemQueued(
DelayedLoad const * item,
int complexity_bytes )
133 this->_loaders.foreach( [&]( DelayedLoader *
const & loader )
135 loader->ItemQueued( item, complexity_bytes );
139 void DelayedLoadSystem::Notify_ItemLoaded(
DelayedLoad const * item,
int complexity_bytes )
142 this->_loaders.foreach( [&]( DelayedLoader *
const & loader )
144 loader->ItemLoaded( item, complexity_bytes );