class Marker {
constructor(square, type) {
this.square = square
this.type = type
}
matches(square = undefined, type = undefined) {
if (!type && !square) {
return true
} else if (!type) {
if (square === this.square) {
return true
}
} else if (!square) {
if (this.type === type) {
return true
}
} else if (this.type === type && square === this.square) {
return true
}
return false
}
}
class Marker {
constructor(square, type) {
this.square = square
this.type = type
}
matches(square = undefined, type = undefined) {
if (!type && !square) {
return true
} else if (!type) {
if (square === this.square) {
return true
}
} else if (!square) {
if (JSON.stringify(this.type) === JSON.stringify(type)) {
return true
}
} else if (JSON.stringify(this.type) === JSON.stringify(type) && square === this.square) {
return true
}
return false
}
}