Rather than have duplicate and largely equivalent methods in each game, this PR generalises the matching validation process.
Now each base player class (Player and Hospital) has their own methods for checking their match(es). These methods make use of the MatchingError exception -- which has also been generalised.
Likewise, each base game (StableRoommates, StableMarriage, HospitalResident) has its own methods for checking their players.
Rather than have duplicate and largely equivalent methods in each game, this PR generalises the matching validation process.
Now each base player class (
Player
andHospital
) has their own methods for checking their match(es). These methods make use of theMatchingError
exception -- which has also been generalised.Likewise, each base game (
StableRoommates
,StableMarriage
,HospitalResident
) has its own methods for checking their players.