public static bool GetSpeeds(object obj, ref double activeSpeed, ref double passiveSpeed) { if (!Enabled) { return(false); } if (m_Table == null) { LoadTable(); } SpeedInfo sp = null; m_Table.TryGetValue(obj.GetType(), out sp); if (sp == null) { return(false); } activeSpeed = sp.ActiveSpeed; passiveSpeed = sp.PassiveSpeed; return(true); }
private static void LoadTable() { m_Table = new Dictionary <Type, SpeedInfo>(); for (int i = 0; i < m_Speeds.Length; ++i) { SpeedInfo info = m_Speeds[i]; Type[] types = info.Types; for (int j = 0; j < types.Length; ++j) { m_Table[types[j]] = info; } } }
public static bool Contains(object obj) { if (!Enabled) { return(false); } if (m_Table == null) { LoadTable(); } SpeedInfo sp = null; m_Table.TryGetValue(obj.GetType(), out sp); return(sp != null); }