player name save/load,komi
This commit is contained in:
1 parent
fbefcdbb7f
commit
b3ee899ec4
4 files changed
+8
-9
No files matched your search
@@ -20,7 +20,7 @@ from katrain.core.constants import (
|
||||
STATUS_ERROR,
|
||||
STATUS_INFO,
|
||||
STATUS_TEACHING,
|
||||
VERSION,
|
||||
VERSION, SGF_INTERNAL_COMMENTS_MARKER,
|
||||
)
|
||||
from katrain.core.engine import KataGoEngine
|
||||
from katrain.core.game_node import GameNode
|
||||
@@ -399,7 +399,7 @@ class Game:
|
||||
x_properties = {}
|
||||
if PROGRAM_NAME in self.root.get_property("AP", ""):
|
||||
for bw in "BW":
|
||||
x_properties["P" + bw] = player_name(self.katrain.players_info[bw])
|
||||
x_properties["P" + bw] = player_name(self.katrain.players_info[bw]) + SGF_INTERNAL_COMMENTS_MARKER
|
||||
player_info = self.katrain.players_info[bw]
|
||||
if player_info.player_type == PLAYER_AI:
|
||||
x_properties[bw + "R"] = rank_label(player_info.calculated_rank)
|
||||
@@ -407,7 +407,7 @@ class Game:
|
||||
x_properties["RE"] = self.end_result
|
||||
x_properties["KTV"] = ANALYSIS_FORMAT_VERSION
|
||||
self.root.properties = {**root_properties, **{k: [v] for k, v in x_properties.items()}}
|
||||
player_names = {bw: re.sub(r"['<>:\"/\\|?*]", "", self.root.get_property("P" + bw, bw)) for bw in "BW"}
|
||||
player_names = {bw: re.sub(r"[\u200b\u3164'<>:\"/\\|?*]", "", self.root.get_property("P" + bw, bw)) for bw in "BW"}
|
||||
base_game_name = f"{PROGRAM_NAME}_{player_names['B']} vs {player_names['W']}"
|
||||
return f"{base_game_name} {self.game_id}.sgf"
|
||||
|
||||
|
||||
Reference in new issue
Block a user