Ejemplo n.º 1
0
        public LevelEntry[] GetPegsIn(RectangleF rect)
        {
            LevelEntryCollection entries = new LevelEntryCollection();

            foreach (LevelEntry le in mEntries)
            {
                if (le.HasPegInfo)
                {
                    RectangleF pBounds = new RectangleF(le.X - 10, le.Y - 10, 20, 20);
                    if (pBounds.IntersectsWith(rect))
                    {
                        entries.Add(le);
                    }
                }
                else if (le is Brick)
                {
                    Brick      b       = (Brick)le;
                    RectangleF bBounds = new RectangleF(b.X - (b.Width / 2), b.Y - (b.Width / 2), b.Width, b.Width);
                    if (bBounds.IntersectsWith(rect))
                    {
                        entries.Add(b);
                    }
                }
            }

            return(entries.ToArray());
        }
Ejemplo n.º 2
0
        public LevelEntry[] GetObjectsIn(RectangleF rect)
        {
            LevelEntryCollection entries = new LevelEntryCollection();

            foreach (LevelEntry le in mEntries)
            {
                RectangleF pBounds = le.Bounds;
                if (pBounds.IntersectsWith(rect))
                {
                    entries.Add(le);
                }
            }

            return(entries.ToArray());
        }