Or if ya wanted to do hashtables the right way would be something more like this.
Code:
public Hashtable _allChars = new Hashtable();
public Hashtable AllChars
{
get
{
if (this._allChars == null)
{
lock (World.SyncRoot)
{
if (this._allChars == null)
{
// Initial capacity of 500 and fastest lookup load factor of 0.1f.
// load factor ranges from 0.1f to 1.0f. 0.1f means very fast lookups
// but increased memory consumption. It also slows the Add/Remove.
// Since world iterates this collection a lot, smallest load factor is necessary.
this._allChars = new Hashtable(500, 0.1f);
}
}
}
return this._allChars;
}
}
Of course this is how it is done using singleton with standard lock plus double-check with public sealed class rather then those public static ones you all use and get the enumeration errors and null ref errors in the hashtables from world.