) -> dict[str, Self]:
collected = {}
for id_, desc in [cls.tokify(line, 2) for line in cls.lines_of(path)]:
+ assert id_ not in collected
assert len(desc) > 1
assert desc[0] in {CHAR_COL_SOLID, CHAR_COL_TRANSPARENT}
collected[id_] = cls(id_, desc[0] == CHAR_COL_SOLID, desc[1:])
alts: dict[str, set[str]] = {}
for design_id, body in [cls.tokify(line, 2)
for line in cls.lines_of(path)]:
+ assert design_id not in collected
assert len(body) > 1
char_type, body = body[0], body[1:]
assert char_type in {CHAR_DESIGN_ALT, CHAR_DESIGN_DESC}
collected = {}
for toks in [cls.tokify(line, 3) for line in cls.lines_of(path)]:
piece_id, design_id = toks[:2]
+ assert piece_id not in collected
color_id, comment = (toks[-1].split(CHAR_SEP_TOKEN, maxsplit=1)
+ [''])[:2]
collected[piece_id] = cls(piece_id, design_id, color_id, comment)