|
|
|
|
|
by hota_mazi
3095 days ago
|
|
It seems nuts to me that anyone would expect the Queen class to extend Bishop just because they happen to move diagonally. A Queen "IS NOT A" Bishop. If anything, specify traits that define the movement of the pieces and have each piece extend that trait (with the Queen extending both CAN_MOVE_DIAGONALLY and CAN_MOVE_LATERALLY). |
|
[0] https://en.wikipedia.org/wiki/Liskov_substitution_principle