2023-06-19 00:39:41 +00:00
|
|
|
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass
|
|
|
|
from typing import ClassVar
|
|
|
|
|
|
|
|
from module.ocr.keyword import Keyword
|
|
|
|
|
|
|
|
|
2023-06-19 17:00:34 +00:00
|
|
|
@dataclass(repr=False)
|
2023-06-19 00:39:41 +00:00
|
|
|
class AssignmentGroup(Keyword):
|
|
|
|
instances: ClassVar = {}
|
|
|
|
entries: tuple[AssignmentEntry] = ()
|
|
|
|
|
|
|
|
|
2023-06-19 17:00:34 +00:00
|
|
|
@dataclass(repr=False)
|
2023-06-19 00:39:41 +00:00
|
|
|
class AssignmentEntry(Keyword):
|
|
|
|
instances: ClassVar = {}
|
|
|
|
group: AssignmentGroup = None
|
2023-09-26 07:06:43 +00:00
|
|
|
|
2023-06-19 00:39:41 +00:00
|
|
|
def __hash__(self) -> int:
|
|
|
|
return super().__hash__()
|
|
|
|
|
2024-05-08 05:47:29 +00:00
|
|
|
@classmethod
|
|
|
|
def _compare(cls, name, keyword):
|
|
|
|
# 2024.05.08 Assignment names are omitted in EN
|
|
|
|
if name == keyword:
|
|
|
|
return True
|
|
|
|
# namelesslandnameless.. Nameless Land, Nameless People
|
|
|
|
if name[:17] == keyword[:17]:
|
|
|
|
return True
|
|
|
|
return False
|
|
|
|
|
2023-09-26 07:06:43 +00:00
|
|
|
|
2024-02-07 13:43:20 +00:00
|
|
|
@dataclass(repr=False)
|
|
|
|
class AssignmentEntryDetailed(Keyword):
|
|
|
|
instances: ClassVar = {}
|
|
|
|
|
|
|
|
|
2023-09-26 07:06:43 +00:00
|
|
|
@dataclass(repr=False)
|
|
|
|
class AssignmentEventGroup(AssignmentGroup):
|
|
|
|
instances: ClassVar = {}
|
|
|
|
|
|
|
|
|
|
|
|
@dataclass(repr=False)
|
|
|
|
class AssignmentEventEntry(AssignmentEntry):
|
|
|
|
instances: ClassVar = {}
|
|
|
|
|
|
|
|
def __hash__(self) -> int:
|
|
|
|
return super().__hash__()
|