Skip to content

Commit

Permalink
doc, #398
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Mar 21, 2023
1 parent 7ff2ab2 commit c83047a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions js/quadrilateral/model/UnorderedComponentPair.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,17 @@ class UnorderedComponentPair<T extends QuadrilateralMovable> {
this.component2 = component2;
}

/**
* Does this pair equal the other?
*/
public equals( otherPair: UnorderedComponentPair<T> ): boolean {
return ( this.component1 === otherPair.component1 && this.component2 === otherPair.component2 ) ||
( this.component2 === otherPair.component1 && this.component1 === otherPair.component2 );
}

/**
* Does this pair include the provided component?
*/
public includesComponent( component: T ): boolean {
return this.component1 === component || this.component2 === component;
}
Expand Down

0 comments on commit c83047a

Please sign in to comment.