You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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(…)
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: