Difficult-Rocket/Difficult_Rocket/mods/__init__.py

73 lines
1.7 KiB
Python
Raw Normal View History

2022-02-08 17:15:09 +08:00
# -------------------------------
# Difficult Rocket
# Copyright © 2021-2022 by shenjackyuanjie
# All rights reserved
# -------------------------------
"""
writen by shenjackyuanjie
mail: 3695888@qq.com
github: @shenjackyuanjie
gitee: @shenjackyuanjie
"""
2022-02-16 13:36:26 +08:00
# system function
2022-02-08 17:15:09 +08:00
from typing import Tuple
2022-02-16 13:36:26 +08:00
# from libs
from libs.semver.semver import VersionInfo
# from DR
from Difficult_Rocket import semver_game_version
2022-02-08 17:15:09 +08:00
from Difficult_Rocket.api.serializer import Serializable
"""
mod系统参数
"""
MOD_loader_version = "0.0.1" # mod系统版本 版本号遵守semver2.0.0
2022-02-16 13:36:26 +08:00
semver_loader_version = VersionInfo.parse(MOD_loader_version)
2022-02-08 17:15:09 +08:00
"""
加载mod时会更改的参数
这里的只是范例,实际加载时会根据mod配置修改
"""
class MODInfo(Serializable):
"""
加载mod时候的参数
"""
"""基本信息"""
name: str # mod名称
2022-02-16 13:36:26 +08:00
version: VersionInfo # mod版本
2022-02-08 17:15:09 +08:00
dependencies: list = [] # mod依赖
"""作者、描述"""
writer: str # 作者
2020-11-28 15:17:44 +08:00
link: str = "" # 作者链接
2022-02-16 13:36:26 +08:00
description: str = "" # 描述 (务必简洁明了)
info: str = "" # 其他信息 (可以很多很多)
2022-02-08 17:15:09 +08:00
"""版本兼容信息"""
2022-02-16 13:36:26 +08:00
write_version: VersionInfo # mod编写版本
write_loader_version: VersionInfo # mod编写的加载器版本
compatible_version: Tuple[VersionInfo, VersionInfo] = (semver_game_version, semver_game_version) # mod兼容版本
2022-02-08 17:15:09 +08:00
# 第一个是最低兼容版本,第二个是最高兼容版本
# 例如: ("1.0.0", "1.1.0")
2022-02-16 13:36:26 +08:00
# 例如: ("1.0.0", "1.1.0")
2022-02-08 17:15:09 +08:00
MOD_info = MODInfo(
name="Difficult_Rocket",
version="0.0.1",
2022-02-16 13:36:26 +08:00
writer="shenjackyuanjie",
write_version=semver_game_version,
write_loader_version=semver_loader_version
2022-02-08 17:15:09 +08:00
)
"""
一些重置用函数
"""