Add: Extract map worlds

This commit is contained in:
LmeSzinc 2023-09-27 00:28:39 +08:00
parent dff1b14706
commit 5cf1f19491
4 changed files with 42 additions and 1 deletions

View File

@ -287,6 +287,8 @@ class KeywordExtract:
gen = self.write_keywords(keyword_class='MapPlane', output_file='',
text_convert=text_convert(world), generator=gen)
gen.write('./tasks/map/keywords/plane.py')
self.load_keywords(['Herta Space Station', 'Jarilo-VI', 'The Xianzhou Luofu'], lang='en')
self.write_keywords(keyword_class='MapWorld', output_file='./tasks/map/keywords/world.py')
def generate_character_keywords(self):
self.load_character_name_keywords()

View File

@ -1,5 +1,6 @@
import tasks.map.keywords.plane as KEYWORDS_MAP_PLANE
from tasks.map.keywords.classes import MapPlane
import tasks.map.keywords.world as KEYWORDS_MAP_WORLD
from tasks.map.keywords.classes import MapPlane, MapWorld
# Herta
KEYWORDS_MAP_PLANE.Herta_StorageZone.floors = ['B1', 'F1', 'F2']
@ -17,5 +18,6 @@ KEYWORDS_MAP_PLANE.Luofu_Cloudford.floors = ['F1', 'F2']
KEYWORDS_MAP_PLANE.Luofu_StargazerNavalia.floors = ['F1', 'F2']
KEYWORDS_MAP_PLANE.Luofu_DivinationCommission.floors = ['F1', 'F2']
KEYWORDS_MAP_PLANE.Luofu_AlchemyCommission.floors = ['F1', 'F2']
KEYWORDS_MAP_PLANE.Luofu_ArtisanshipCommission.page = 'bottom'
KEYWORDS_MAP_PLANE.Luofu_AlchemyCommission.page = 'bottom'
KEYWORDS_MAP_PLANE.Luofu_ScalegorgeWaterscape.page = 'bottom'

View File

@ -107,3 +107,8 @@ class MapPlane(Keyword):
raise ScriptError(f'Plane {self} does not have floor name {floor}')
else:
raise ScriptError(f'Plane {self} does not have floor {floor}')
@dataclass(repr=False)
class MapWorld(Keyword):
instances: ClassVar = {}

View File

@ -0,0 +1,32 @@
from .classes import MapWorld
# This file was auto-generated, do not modify it manually. To generate:
# ``` python -m dev_tools.keyword_extract ```
Herta_Space_Station = MapWorld(
id=1,
name='Herta_Space_Station',
cn='空间站「黑塔」',
cht='太空站「黑塔」',
en='Herta Space Station',
jp='宇宙ステーション「ヘルタ」',
es='Estación Espacial Herta',
)
Jarilo_VI = MapWorld(
id=2,
name='Jarilo_VI',
cn='雅利洛-Ⅵ',
cht='雅利洛-Ⅵ',
en='Jarilo-VI',
jp='ヤリーロ-VI',
es='Jarilo-VI',
)
The_Xianzhou_Luofu = MapWorld(
id=3,
name='The_Xianzhou_Luofu',
cn='仙舟「罗浮」',
cht='仙舟「羅浮」',
en='The Xianzhou Luofu',
jp='仙舟「羅浮」',
es='El Luofu de Xianzhou',
)