botbowl icon indicating copy to clipboard operation
botbowl copied to clipboard

Easier way to create a game

Open njustesen opened this issue 3 years ago • 1 comments

There are currently too many steps to take to create a game. This should be hidden away in either the constructor of Game og as a helper function.

The current steps are:

# Setup a game
config = botbowl.load_config("bot-bowl-iii")
ruleset = botbowl.load_rule_set(config.ruleset)
arena = botbowl.load_arena(config.arena)
home = botbowl.load_team_by_filename("human", ruleset)
away = botbowl.load_team_by_filename("human", ruleset)
agent_home = Agent("home agent", human=True)
agent_away = Agent("home agent", human=True)
game = botbowl.Game(1, home, away, agent_home, agent_away, config, arena=arena, ruleset=ruleset)
game.init()

njustesen avatar Jan 18 '22 11:01 njustesen

I think helper functions is the way to go! Similar to the game creating functions in tests.util but with more arguments.

mrbermell avatar Jan 18 '22 11:01 mrbermell