public string SpawnedStats()
{
Defrag();
Dictionary<string, int> counts = new Dictionary<string, int>( StringComparer.OrdinalIgnoreCase );
foreach ( string entry in m_SpawnNames )
{
string name = ParseType( entry );
Type type = ScriptCompiler.FindTypeByName( name );
if ( type == null )
counts[name] = 0;
else
counts[type.Name] = 0;
}
foreach ( ISpawnable spawned in m_Spawned )
{
string name = spawned.GetType().Name;
if ( counts.ContainsKey( name ) )
++counts[name];
else
counts[name] = 1;
}
List<string> names = new List<string>( counts.Keys );
names.Sort();
StringBuilder result = new StringBuilder();
for ( int i = 0; i < names.Count; ++i )
result.AppendFormat( "{0}{1}: {2}", ( i == 0 ) ? "" : "<BR>", names[i], counts[names[i]] );
return result.ToString();
}