Fixed grammar, unified the docstring's format and added documentation to some classes that did not have any. Closes #32.
This commit is contained in:
@ -16,12 +16,11 @@ class DisplayActions(Enum):
|
||||
"""
|
||||
REFRESH = auto()
|
||||
UPDATE = auto()
|
||||
MOUSE = auto()
|
||||
|
||||
|
||||
class GameMode(Enum):
|
||||
"""
|
||||
Game mode options
|
||||
Game mode options.
|
||||
"""
|
||||
MAINMENU = auto()
|
||||
PLAY = auto()
|
||||
@ -32,9 +31,8 @@ class GameMode(Enum):
|
||||
|
||||
class KeyValues(Enum):
|
||||
"""
|
||||
Key values options used in the game
|
||||
Key values options used in the game.
|
||||
"""
|
||||
MOUSE = auto()
|
||||
UP = auto()
|
||||
DOWN = auto()
|
||||
LEFT = auto()
|
||||
@ -46,12 +44,11 @@ class KeyValues(Enum):
|
||||
DROP = auto()
|
||||
SPACE = auto()
|
||||
CHAT = auto()
|
||||
WAIT = auto()
|
||||
|
||||
@staticmethod
|
||||
def translate_key(key: str, settings: Settings) -> Optional["KeyValues"]:
|
||||
"""
|
||||
Translate the raw string key into an enum value that we can use.
|
||||
Translates the raw string key into an enum value that we can use.
|
||||
"""
|
||||
if key in (settings.KEY_DOWN_SECONDARY,
|
||||
settings.KEY_DOWN_PRIMARY):
|
||||
@ -79,6 +76,4 @@ class KeyValues(Enum):
|
||||
return KeyValues.SPACE
|
||||
elif key == settings.KEY_CHAT:
|
||||
return KeyValues.CHAT
|
||||
elif key == settings.KEY_WAIT:
|
||||
return KeyValues.WAIT
|
||||
return None
|
||||
|
Reference in New Issue
Block a user