-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
41 lines (31 loc) · 1.21 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from typing import Dict, Any
import logging
from InquirerPy.utils import color_print
from InquirerPy import inquirer
from common.environments.interactive_game_runner import InteractiveGameRunner
from core.constants.logging import VERBOSE_LOG_LEVEL
def _configure_logging():
logging.basicConfig(
format='[%(levelname)s] %(message)s',
level=VERBOSE_LOG_LEVEL)
logging.addLevelName(logging.CRITICAL, "FTL")
logging.addLevelName(logging.ERROR, "ERR")
logging.addLevelName(logging.WARNING, "WRN")
logging.addLevelName(logging.INFO, "INF")
logging.addLevelName(logging.DEBUG, "DBG")
logging.addLevelName(VERBOSE_LOG_LEVEL, "VRB")
logging.getLogger('asyncio').setLevel(logging.WARN)
if __name__ == "__main__":
_configure_logging()
color_print(
formatted_text=[("", "Welcome to...\r\n"), ("class:emphasis", "Cavernabot!"), ("","\r\n")],
style={"emphasis": "fg:yellow bold"},
)
number_of_players = int(inquirer.number(
message="How many players are playing?",
min_allowed=2,
max_allowed=7
).execute())
print()
game_runner: InteractiveGameRunner = InteractiveGameRunner(number_of_players)
game_runner.run()