修复一大堆类型报错(虽说是

以及一个拼写(?)错误
This commit is contained in:
shenjack-5600u 2024-05-15 21:13:55 +08:00
parent b99170f0c7
commit 49ac2b9d29
Signed by: shenjack
GPG Key ID: FDF9864E11C7E79F

View File

@ -20,6 +20,7 @@ if TYPE_CHECKING:
获取版本号 获取版本号
:return: 版本号 :return: 版本号
""" """
...
def part_list_read_test( def part_list_read_test(
file_name: Optional[str] = "./assets/builtin/PartList.xml" file_name: Optional[str] = "./assets/builtin/PartList.xml"
@ -42,6 +43,7 @@ if TYPE_CHECKING:
:param part_type: :param part_type:
:return: :return:
""" """
...
class SR1PartType_rs: # NOQA class SR1PartType_rs: # NOQA
""" """
@ -53,34 +55,42 @@ if TYPE_CHECKING:
@property @property
def name(self) -> str: def name(self) -> str:
"""零件的名字""" """零件的名字"""
...
@property @property
def description(self) -> str: def description(self) -> str:
"""零件的描述""" """零件的描述"""
...
@property @property
def sprite(self) -> str: def sprite(self) -> str:
"""零件的贴图""" """零件的贴图"""
...
@property @property
def mass(self) -> float: def mass(self) -> float:
"""零件的质量""" """零件的质量"""
...
@property @property
def width(self) -> int: def width(self) -> int:
"""零件的宽度""" """零件的宽度"""
...
@property @property
def height(self) -> int: def height(self) -> int:
"""零件的高度""" """零件的高度"""
...
@property @property
def friction(self) -> float: def friction(self) -> float:
"""零件的摩擦系数""" """零件的摩擦系数"""
...
@property @property
def hidden(self) -> bool: def hidden(self) -> bool:
"""零件是否隐藏""" """零件是否隐藏"""
...
@property @property
def type(self): def type(self):
@ -194,15 +204,18 @@ if TYPE_CHECKING:
@property @property
def mass(self) -> float: def mass(self) -> float:
"""获取整搜船的质量""" """获取整艘船的质量"""
...
@property @property
def img_pos(self) -> Tuple[int, int, int, int]: def img_pos(self) -> Tuple[int, int, int, int]:
"""-x -y +x +y 左下右上""" """-x -y +x +y 左下右上"""
...
@property @property
def connection(self) -> List[Tuple[int, int, int, int]]: def connection(self) -> List[Tuple[int, int, int, int]]:
"""获取所有连接信息""" """获取所有连接信息"""
...
def get_part_box( def get_part_box(
self, part_id: int self, part_id: int
@ -211,9 +224,11 @@ if TYPE_CHECKING:
def as_list(self) -> List[Tuple[SR1PartType_rs, SR1PartData_rs]]: def as_list(self) -> List[Tuple[SR1PartType_rs, SR1PartData_rs]]:
"""用于返回一个包含所有已连接零件的列表""" """用于返回一个包含所有已连接零件的列表"""
...
def as_dict(self) -> Dict[int, List[Tuple[SR1PartType_rs, SR1PartData_rs]]]: def as_dict(self) -> Dict[int, List[Tuple[SR1PartType_rs, SR1PartData_rs]]]:
"""用于返回一个包含所有已连接零件的字典""" """用于返回一个包含所有已连接零件的字典"""
...
def save( def save(
self, file_path: str, save_status: Optional[SaveStatus_rs] = None self, file_path: str, save_status: Optional[SaveStatus_rs] = None