示例#1
0
 public bool Contains(GridPoint target)
 {
   var gps = new[] { gridPoint1, gridPoint2 };
   if (gps.Any(gp => gp != null && gp.HasSameCoordinatesWith(target)))
   {
     return true;
   }
   return false;
 }
示例#2
0
    public bool IsNeighborOf(GridPoint other)
    {
      if (
        (IsNeighbor(this.X, other.X) && this.Y == other.Y)
        ^ (IsNeighbor(this.Y, other.Y) && this.X == other.X)
        ) return true;

      return false;
    }
示例#3
0
 public GridPointSet(GridPoint gridPoint1, GridPoint gridPoint2)
 {
   this.gridPoint1 = gridPoint1;
   this.gridPoint2 = gridPoint2;
 }
示例#4
0
 public bool HasSameCoordinatesWith(GridPoint other)
 {
   if (this.X != other.X) return false;
   if (this.Y != other.Y) return false;
   return true;
 }