public bool Contains(GridPoint target) { var gps = new[] { gridPoint1, gridPoint2 }; if (gps.Any(gp => gp != null && gp.HasSameCoordinatesWith(target))) { return true; } return false; }
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; }
public GridPointSet(GridPoint gridPoint1, GridPoint gridPoint2) { this.gridPoint1 = gridPoint1; this.gridPoint2 = gridPoint2; }
public bool HasSameCoordinatesWith(GridPoint other) { if (this.X != other.X) return false; if (this.Y != other.Y) return false; return true; }