public static Portal getCurPortal(double heroX, double heroY)
        {
            IEnumerator enumerator;

            try
            {
                enumerator = curPortals.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    Portal current = (Portal)enumerator.Current;
                    if ((((heroX - current.getPosX()) < 1000.0) & ((heroX - current.getPosX()) > 0.0)) && (((heroY - current.getPosY()) < 1000.0) & ((heroY - current.getPosY()) > 0.0)))
                    {
                        return(current);
                    }
                }
            }
            finally
            {
                if (enumerator is IDisposable)
                {
                    (enumerator as IDisposable).Dispose();
                }
            }
            return(null);
        }
        public static void setAllPortals(ArrayList portals)
        {
            IEnumerator enumerator;

            removeAllPortals();
            try
            {
                enumerator = portals.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    Portal current = (Portal)enumerator.Current;
                    curPortals.Add(current);
                    initConnection.sendPacket("0|p|" + Conversions.ToString(current.getID()) + "|1|0|" + Conversions.ToString(current.getPosX()) + "|" + Conversions.ToString(current.getPosY()));
                }
            }
            finally
            {
                if (enumerator is IDisposable)
                {
                    (enumerator as IDisposable).Dispose();
                }
            }
        }