示例#1
0
 public abstract bool Collide(GridMask mask, float dx = 0, float dy = 0);
示例#2
0
 public override bool Collide(GridMask mask, float dx = 0, float dy = 0)
 {
     throw new NotImplementedException();
 }
示例#3
0
 public override bool Collide(GridMask mask, float dx = 0, float dy = 0)
 {
     return mask.Collide(this, -dx, -dy);
 }
示例#4
0
 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;
 }