mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Add --invert to the game generator.
This commit is contained in:
parent
409e070887
commit
905175c210
@ -128,11 +128,17 @@ def parse_args() -> argparse.Namespace:
|
|||||||
help="Automate bluefor procurement."
|
help="Automate bluefor procurement."
|
||||||
)
|
)
|
||||||
|
|
||||||
|
new_game.add_argument(
|
||||||
|
"--inverted", action="store_true",
|
||||||
|
help="Invert the campaign."
|
||||||
|
)
|
||||||
|
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
def create_game(campaign_path: Path, blue: str, red: str,
|
def create_game(campaign_path: Path, blue: str, red: str,
|
||||||
supercarrier: bool, auto_procurement: bool) -> Game:
|
supercarrier: bool, auto_procurement: bool,
|
||||||
|
inverted: bool) -> Game:
|
||||||
campaign = Campaign.from_json(campaign_path)
|
campaign = Campaign.from_json(campaign_path)
|
||||||
generator = GameGenerator(
|
generator = GameGenerator(
|
||||||
blue, red, campaign.load_theater(),
|
blue, red, campaign.load_theater(),
|
||||||
@ -147,7 +153,7 @@ def create_game(campaign_path: Path, blue: str, red: str,
|
|||||||
player_budget=DEFAULT_BUDGET,
|
player_budget=DEFAULT_BUDGET,
|
||||||
enemy_budget=DEFAULT_BUDGET,
|
enemy_budget=DEFAULT_BUDGET,
|
||||||
midgame=False,
|
midgame=False,
|
||||||
inverted=False,
|
inverted=inverted,
|
||||||
no_carrier=False,
|
no_carrier=False,
|
||||||
no_lha=False,
|
no_lha=False,
|
||||||
no_player_navy=False,
|
no_player_navy=False,
|
||||||
@ -168,7 +174,8 @@ def main():
|
|||||||
args = parse_args()
|
args = parse_args()
|
||||||
if args.subcommand == "new-game":
|
if args.subcommand == "new-game":
|
||||||
game = create_game(args.campaign, args.blue, args.red,
|
game = create_game(args.campaign, args.blue, args.red,
|
||||||
args.supercarrier, args.auto_procurement)
|
args.supercarrier, args.auto_procurement,
|
||||||
|
args.inverted)
|
||||||
|
|
||||||
run_ui(game)
|
run_ui(game)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user