public string SpawnedStats()
{
Defrag();
var 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;
}
var names = new List < string >(counts.Keys);
names.Sort();
var 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();
}