pep.py/constants/gameModes.py
Nyo 653303831b IRC Support for username with spaces
BATs with Donor have bright yellow username in chat
General performance improvements
Code cleaning
Multiplayer improvements and fixes
Fixed some spectator bugs
2016-09-02 12:41:19 +02:00

36 lines
769 B
Python

std = 0
taiko = 1
ctb = 2
mania = 3
def getGameModeForDB(gameMode):
"""
Convert a gamemode number to string for database table/column
gameMode -- gameMode int or variable (ex: gameMode.std)
return -- game mode readable string for db
"""
if gameMode == std:
return "std"
elif gameMode == taiko:
return "taiko"
elif gameMode == ctb:
return "ctb"
else:
return "mania"
def getGameModeForPrinting(gameMode):
"""
Convert a gamemode number to string for showing to a user (e.g. !last)
gameMode -- gameMode int or variable (ex: gameMode.std)
return -- game mode readable string for a human
"""
if gameMode == std:
return "osu!"
elif gameMode == taiko:
return "Taiko"
elif gameMode == ctb:
return "CatchTheBeat"
else:
return "osu!mania"