-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
39 lines (28 loc) · 926 Bytes
/
main.py
File metadata and controls
39 lines (28 loc) · 926 Bytes
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
import argparse
from icecream import ic
from core.abstract import App
from core.config import get_settings
def main() -> None:
# TODO: desabilitar icecream de acordo com argumento CLI
ic.configureOutput(prefix="🍦 DEBUG | ")
parser = argparse.ArgumentParser(description="Bomberman Online - Cliente/Servidor")
parser.add_argument(
"--mode",
"-m",
choices=["client", "server"],
default="client",
help="Modo de execução: 'client' ou 'server' (padrão: client)",
)
args = parser.parse_args()
app_cls: type[App] | None = None
if args.mode == "client":
from client.app import ClientApp
app_cls = ClientApp
elif args.mode == "server":
from server.app import ServerApp
app_cls = ServerApp
if app_cls is not None:
app = app_cls(get_settings())
app.run()
if __name__ == "__main__":
main()