add Deleted property to IEntity

cleanup Map.GetObjectsInRange
additional hashtable -> dictionary conversions
generic timer impl for EffectController
This commit is contained in:
Mark Sturgill 2013-11-02 10:52:08 -07:00
parent 4fccb0c3d3
commit 436e8f054a
7 changed files with 84 additions and 76 deletions

View file

@ -1,5 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using Server;
@ -43,22 +42,22 @@ namespace Server.Engines.BulkOrders
get{ return GetEntries( "Tailoring", "leather" ); }
}
private static Hashtable m_Cache;
private static Dictionary<string, Dictionary<string, SmallBulkEntry[]>> m_Cache;
public static SmallBulkEntry[] GetEntries( string type, string name )
{
if ( m_Cache == null )
m_Cache = new Hashtable();
m_Cache = new Dictionary<string, Dictionary<string, SmallBulkEntry[]>>();
Hashtable table = (Hashtable)m_Cache[type];
Dictionary<string, SmallBulkEntry[]> table = null;
if ( table == null )
m_Cache[type] = table = new Hashtable();
if (!m_Cache.TryGetValue(type, out table))
m_Cache[type] = table = new Dictionary<string, SmallBulkEntry[]>();
SmallBulkEntry[] entries = (SmallBulkEntry[])table[name];
SmallBulkEntry[] entries = null;
if ( entries == null )
table[name] = entries = LoadEntries( type, name );
if (!table.TryGetValue(name, out entries))
table[name] = entries = LoadEntries(type, name);
return entries;
}