Skip to content

Commit 74efdbc

Browse files
committed
Add get_human
1 parent 892b715 commit 74efdbc

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

rlbot/config.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from typing import Any, Literal
44

55
import rlbot.flat as flat
6-
from rlbot.utils.logging import DEFAULT_LOGGER as logger
76
from rlbot.utils.os_detector import CURRENT_OS, OS
87

98

@@ -112,7 +111,7 @@ def load_match_config(config_path: Path | str) -> flat.MatchConfiguration:
112111
)
113112
)
114113
case "human":
115-
players.append(flat.PlayerConfiguration(flat.Human(), team, 0))
114+
players.append(get_human(team))
116115
case t:
117116
raise ConfigParsingException(
118117
f"Invalid player type {repr(t)} for player {len(players)}."
@@ -323,6 +322,13 @@ def load_psyonix_config(
323322
)
324323

325324

325+
def get_human(team: int) -> flat.PlayerConfiguration:
326+
"""
327+
Creates a `PlayerConfiguration` for a human player on the given team.
328+
"""
329+
return flat.PlayerConfiguration(flat.Human(), team)
330+
331+
326332
def load_script_config(path: Path | str) -> flat.ScriptConfiguration:
327333
"""
328334
Reads the script toml file at the provided path and creates a `ScriptConfiguration` from it.

0 commit comments

Comments
 (0)