23 for ( i = 0; i < m_PluginsPtrs.Count(); ++i)
25 plugin = m_PluginsPtrs.GetElement(i);
104 int regCount = m_PluginRegister.Count();
107 pluginPtrs.Reserve(regCount);
109 foreach (
typename pluginType : m_PluginRegister)
111 PluginBase moduleExist = GetPluginByType( pluginType );
114 m_PluginsPtrs.Remove( pluginType );
118 m_PluginsPtrs.Set(pluginType, moduleNew);
119 pluginPtrs.Insert(moduleNew);
134 void MainOnUpdate(
float delta_time)
136 for (
int i = 0; i < m_PluginsPtrs.Count(); ++i)
138 PluginBase plugin = m_PluginsPtrs.GetElement(i);
139 if ( plugin != NULL )
141 plugin.OnUpdate(delta_time);
157 PluginBase GetPluginByType(
typename plugin_type )
159 if ( m_PluginsPtrs.Contains( plugin_type ) )
161 return m_PluginsPtrs.Get( plugin_type );
183 protected void RegisterPlugin(
string plugin_class_name,
bool reg_on_client,
bool reg_on_server,
bool reg_on_release =
true )
185 if ( !reg_on_client )
193 if ( !reg_on_server )
195 if (
GetGame().IsMultiplayer() )
204 if ( !reg_on_release )
212 m_PluginRegister.Insert( plugin_class_name.ToType() );
233 RegisterPlugin(plugin_class_name, reg_on_client, reg_on_server,
false);
238 protected void RegisterPluginDiag(
string plugin_class_name,
bool reg_on_client,
bool reg_on_server )
240 #ifdef DIAG_DEVELOPER
241 RegisterPlugin(plugin_class_name, reg_on_client, reg_on_server,
true);
252 typename plugin_type = plugin_class_name.ToType();
254 if ( m_PluginRegister.Find( plugin_type ) != -1 )
256 m_PluginRegister.RemoveItem( plugin_type );
324 if ( plugin == null )
326 #ifdef DIAG_DEVELOPER
329 PrintString(
"Module " + plugin_type.ToString() +
" is not Registred in PluginManager.c!");
343 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 native CGame GetGame()
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)
class PluginManager g_Plugins
void PluginManagerDelete()