MegaMan.LevelEditor.ScreenDocument.EntityBounded C# (CSharp) Method

EntityBounded() private method

private EntityBounded ( EntityPlacement entityInfo, Point location ) : bool
entityInfo MegaMan.Common.EntityPlacement
location Point
return bool
        private bool EntityBounded(EntityPlacement entityInfo, Point location)
        {
            Entity entity = Stage.Project.EntityByName(entityInfo.entity);
            RectangleF bounds;

            if (entity.MainSprite == null)
            {
                bounds = new RectangleF(-8, -8, 16, 16);
            }
            else
            {
                bounds = entity.MainSprite.BoundBox;
                bounds.Offset(-entity.MainSprite.HotSpot.X, -entity.MainSprite.HotSpot.Y);
            }

            bounds.Offset(entityInfo.screenX, entityInfo.screenY);
            return bounds.Contains(location);
        }