From 6a8ca810ff3026c0de244c7e35b2bf8ddb6c31c7 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Sat, 5 Dec 2020 23:20:58 -0800 Subject: [PATCH] Add auto-procure option to the CLI generator. --- qt_ui/main.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/qt_ui/main.py b/qt_ui/main.py index 62c5be94..aab24a62 100644 --- a/qt_ui/main.py +++ b/qt_ui/main.py @@ -123,15 +123,25 @@ def parse_args() -> argparse.Namespace: help="Use the supercarrier module." ) + new_game.add_argument( + "--auto-procurement", action="store_true", + help="Automate bluefor procurement." + ) + return parser.parse_args() def create_game(campaign_path: Path, blue: str, red: str, - supercarrier: bool) -> Game: + supercarrier: bool, auto_procurement: bool) -> Game: campaign = Campaign.from_json(campaign_path) generator = GameGenerator( blue, red, campaign.load_theater(), - Settings(supercarrier=supercarrier), + Settings( + supercarrier=supercarrier, + automate_runway_repair=auto_procurement, + automate_front_line_reinforcements=auto_procurement, + automate_aircraft_reinforcements=auto_procurement + ), GeneratorSettings( start_date=datetime.today(), player_budget=DEFAULT_BUDGET, @@ -159,7 +169,7 @@ def main(): args = parse_args() if args.subcommand == "new-game": game = create_game(args.campaign, args.blue, args.red, - args.supercarrier) + args.supercarrier, args.auto_procurement) run_ui(game)