Remake isLegal method in RuleManager

The getAllAvailableMoves method allowed to make the isLegal method more concise.