Gespiegelte Felder werden richtig erkannt

This commit is contained in:
silas
2018-10-21 18:09:50 +02:00
parent 0af8f4d7b1
commit 703edc8526
5 changed files with 11 additions and 7 deletions

View File

@@ -5333,6 +5333,7 @@ class LeafSegment extends Segment {
}
sameAs(otherSegment) {
// debugger;
return (otherSegment instanceof LeafSegment && otherSegment.leaf === this.leaf);
}
@@ -5521,9 +5522,10 @@ class ParentSegment extends Segment {
return false;
}
}
console.log(this.rotation, this.children, this.children[0].sameAs(this.children[3]), this.children[1].sameAs(this.children[2]), this.children[0].sameAs(this.children[1]));
return (this.rotation === 0 || (
this.children[0].sameAs(this.children[2]) && this.children[1].sameAs(this.children[3]) && (
this.rotation === 2 || this.children[0].sameAs(this.children[1]))))
this.children[0].sameAs(this.children[3]) && this.children[1].sameAs(this.children[2]) && (
this.rotation === 180 || this.children[0].sameAs(this.children[1]))))
}
setChildren(children) {