public abstract bool Collide(GridMask mask, float dx = 0, float dy = 0);
public override bool Collide(GridMask mask, float dx = 0, float dy = 0) { throw new NotImplementedException(); }
public override bool Collide(GridMask mask, float dx = 0, float dy = 0) { return mask.Collide(this, -dx, -dy); }
public override bool Collide(GridMask mask, float dx = 0, float dy = 0) { if (Intersects(mask.AbsoluteLeft, mask.AbsoluteTop, mask.Width, mask.Height, dx, dy)) { int x = (int)((AbsoluteLeft + dx - mask.AbsoluteLeft) / mask.CellWidth); int y = (int)((AbsoluteTop + dy - mask.AbsoluteTop) / mask.CellHeight); int width = (int)((AbsoluteRight + dx - mask.AbsoluteLeft - 1) / mask.CellWidth) - x + 1; int height = (int)((AbsoluteBottom + dy - mask.AbsoluteTop - 1) / mask.CellHeight) - y + 1; return mask.CheckRegion(x, y, width, height); } return false; }