コード例 #1
0
 public bool EqualsNonDirectional(CoordinateString2 <T> other)
 {
     if (this.Coordinates.Length != other.Coordinates.Length)
     {
         return(false);
     }
     if (this.Coordinates[0].Equals(other.Coordinates[0]))
     {
         for (int i = 0; i < this.Coordinates.Length; i++)
         {
             if (!this.Coordinates[i].Equals(other.Coordinates[i]))
             {
                 return(false);
             }
         }
         return(true);
     }
     else if (this.Coordinates[this.Coordinates.Length - 1].Equals(other.Coordinates[0]))
     {
         int id = this.Coordinates.Length - 1;
         for (int i = 0; i < this.Coordinates.Length; i++)
         {
             if (!this.Coordinates[id - i].Equals(other.Coordinates[i]))
             {
                 return(false);
             }
         }
         return(true);
     }
     return(false);
 }
コード例 #2
0
 public CoordinateString2(CoordinateString2 <T> other)
 {
     if (other == null)
     {
         throw new ArgumentNullException();
     }
     this.Coordinates = new Coordinate2 <T> [other.Coordinates.Length];
     Array.Copy(other.Coordinates, this.Coordinates, this.Coordinates.Length);
 }
コード例 #3
0
 public bool Equals(CoordinateString2 <T> other)
 {
     if (this.Coordinates.Length != other.Coordinates.Length)
     {
         return(false);
     }
     for (int i = 0; i < this.Coordinates.Length; i++)
     {
         if (!this.Coordinates[i].Equals(other.Coordinates[i]))
         {
             return(false);
         }
     }
     return(true);
 }