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); }
public static bool GetSpeeds(object obj, ref double activeSpeed, ref double passiveSpeed) { if (!Enabled) { return(false); } if (m_Table == null) { LoadTable(); } SpeedInfo sp = (SpeedInfo)m_Table[obj.GetType()]; /*if (sp == null) * { * return false; * }*/ /*activeSpeed = sp.ActiveSpeed; * passiveSpeed = sp.PassiveSpeed;*/ activeSpeed = 0.215; passiveSpeed = 0.50; return(true); }
private static void LoadTable() { m_Table = new Hashtable(); 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 = (SpeedInfo)m_Table[obj.GetType()]; return(sp != null); }
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); }
public static bool GetSpeeds(object obj, ref double activeSpeed, ref double passiveSpeed) { if (!Enabled) { return(false); } if (m_Table == null) { LoadTable(); } SpeedInfo sp = (SpeedInfo)m_Table[obj.GetType()]; if (sp == null) { return(false); } activeSpeed = sp.ActiveSpeed; passiveSpeed = sp.PassiveSpeed; return(true); }