-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcmdparser.py
More file actions
33 lines (27 loc) · 952 Bytes
/
cmdparser.py
File metadata and controls
33 lines (27 loc) · 952 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
import argparse
from config import (
SINGLEPLAYER_MODE, HOT_MULTIPLAYER_MODE, CO_OP_MODE, DIFFICULTY_EASY,
DIFFICULTY_HARD, DIFFICULTY_NORMAL, DIFFICULTY_NIGHTMARE)
def parse_game_cmd_args():
""" Initializes and parses cmd args. """
parser = argparse.ArgumentParser(
description='Capture the Flag game with Tanks!')
parser.add_argument(
"--game-mode",
type=str,
default=SINGLEPLAYER_MODE,
choices=(SINGLEPLAYER_MODE, HOT_MULTIPLAYER_MODE, CO_OP_MODE),
help="set the game mode"
)
parser.add_argument(
"--map",
type=str,
default="map0.json",
help="set the map to play."
)
parser.add_argument(
"--difficulty", type=str, default=DIFFICULTY_NORMAL,
choices=(DIFFICULTY_EASY, DIFFICULTY_NORMAL, DIFFICULTY_HARD,
DIFFICULTY_NIGHTMARE),
help="set the map to play.")
return parser.parse_args()