Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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;
                }
            }
        }
Exemplo n.º 3
0
        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);
        }