Currently it is annoying to have to use a chain of if and elif statements to handle the TTTStatusCodes.
Rough suggestion by htns to use polymorphism instead
@abstract
class Response:
@abstract
def getMessage()->str: …
class SuccessResponse(Response):
def getMessage()->str:
actual implementation here
class NotInLobbyResponse(Response):
def getMessage()->str:
actual implementation here
class Lobbies:
def place(…) → Response:
if …:
return SuccessResponse(…)
else:
return NotInLobbyResponse(…)
Currently it is annoying to have to use a chain of
if
andelif
statements to handle theTTTStatusCode
s.Rough suggestion by htns to use polymorphism instead