23 for ( i = 0; i < m_PluginsPtrs.Count(); ++i)
25 plugin = m_PluginsPtrs.GetElement(i);
112 int regCount = m_PluginRegister.Count();
115 pluginPtrs.Reserve(regCount);
117 foreach (
typename pluginType : m_PluginRegister)
119 PluginBase moduleExist = GetPluginByType( pluginType );
122 m_PluginsPtrs.Remove( pluginType );
126 m_PluginsPtrs.Set(pluginType, moduleNew);
127 pluginPtrs.Insert(moduleNew);
142 void MainOnUpdate(
float delta_time)
144 int nPlugins = m_PluginsPtrs.Count();
145 for (
int i = 0; i < nPlugins; ++i)
147 PluginBase plugin = m_PluginsPtrs.GetElement(i);
148 if ( plugin != NULL )
150 plugin.OnUpdate(delta_time);
166 PluginBase GetPluginByType(
typename plugin_type )
168 if ( m_PluginsPtrs.Contains( plugin_type ) )
170 return m_PluginsPtrs.Get( plugin_type );
192 protected void RegisterPlugin(
string plugin_class_name,
bool reg_on_client,
bool reg_on_server,
bool reg_on_release =
true )
194 if ( !reg_on_client )
202 if ( !reg_on_server )
204 if (
g_Game.IsMultiplayer() )
213 if ( !reg_on_release )
221 m_PluginRegister.Insert( plugin_class_name.ToType() );
242 RegisterPlugin(plugin_class_name, reg_on_client, reg_on_server,
false);
247 protected void RegisterPluginDiag(
string plugin_class_name,
bool reg_on_client,
bool reg_on_server )
249 #ifdef DIAG_DEVELOPER
250 RegisterPlugin(plugin_class_name, reg_on_client, reg_on_server,
true);
261 typename plugin_type = plugin_class_name.ToType();
263 if ( m_PluginRegister.Find( plugin_type ) != -1 )
265 m_PluginRegister.RemoveItem( plugin_type );
333 if ( plugin == null )
335 #ifdef DIAG_DEVELOPER
338 PrintString(
"Module " + plugin_type.ToString() +
" is not Registred in PluginManager.c!");
365 return (
GetPlugin(plugin_type) != NULL );
Plugin interface for controlling of agent pool system.
void RegisterPluginDebug(string plugin_class_name, bool reg_on_client, bool reg_on_server)
Register new PluginBase to PluginManager for storing and handling plugin.
bool UnregisterPlugin(string plugin_class_name)
void RegisterPluginDiag(string plugin_class_name, bool reg_on_client, bool reg_on_server)
void RegisterPlugin(string plugin_class_name, bool reg_on_client, bool reg_on_server, bool reg_on_release=true)
Register new PluginBase to PluginManager for storing and handling plugin.
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto void DumpStack()
Prints current call stack (stack trace).
class array< Class T > PrintString
PluginManager GetPluginManager()
Returns registred plugin by class type, better is to use global funtion GetPlugin(typename plugin_typ...
PluginBase GetPlugin(typename plugin_type)
bool IsPluginManagerExists()
bool IsModuleExist(typename plugin_type)
PluginBase GetPluginSafe(typename plugin_type)
class PluginManager g_Plugins
void PluginManagerDelete()