From 109ff00bb1599914a90f4c255d2c185fe357d9c6 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Sat, 23 Dec 2023 01:38:08 +0800 Subject: [PATCH] =?UTF-8?q?Remove=20|=20=E7=A7=BB=E9=99=A4=E6=B2=A1?= =?UTF-8?q?=E7=94=A8=E7=9A=84=E4=B8=9C=E8=A5=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Difficult_Rocket_rs/src/src/data_type/dr.rs | 6 ------ .../Difficult_Rocket_rs/src/src/data_type/sr1.rs | 7 +++---- mods/dr_game/Difficult_Rocket_rs/src/src/lib.rs | 15 --------------- mods/dr_game/__init__.py | 1 - 4 files changed, 3 insertions(+), 26 deletions(-) diff --git a/mods/dr_game/Difficult_Rocket_rs/src/src/data_type/dr.rs b/mods/dr_game/Difficult_Rocket_rs/src/src/data_type/dr.rs index b0778f8..0567291 100644 --- a/mods/dr_game/Difficult_Rocket_rs/src/src/data_type/dr.rs +++ b/mods/dr_game/Difficult_Rocket_rs/src/src/data_type/dr.rs @@ -181,9 +181,3 @@ pub struct DRComponentProps<'a, T> { // 附加属性 pub attr: HashMap<&'a str, T>, } - -impl<'a, T> DRComponentProps<'a, T> { - pub fn fetch_data(&self, name: &str) -> Option<&T> { - self.attr.get(name) - } -} diff --git a/mods/dr_game/Difficult_Rocket_rs/src/src/data_type/sr1.rs b/mods/dr_game/Difficult_Rocket_rs/src/src/data_type/sr1.rs index dc9a7aa..e6b0f87 100644 --- a/mods/dr_game/Difficult_Rocket_rs/src/src/data_type/sr1.rs +++ b/mods/dr_game/Difficult_Rocket_rs/src/src/data_type/sr1.rs @@ -555,8 +555,7 @@ impl SR1PartDataAttr { current_stage: Option, steps: Option>>, extension: Option, - chute_x: Option, - chute_y: Option, + chute_pos: (Option, Option), chute_height: Option, chute_angle: Option, inflate: Option, @@ -572,8 +571,8 @@ impl SR1PartDataAttr { current_stage, steps, extension, - chute_x, - chute_y, + chute_x: chute_pos.0, + chute_y: chute_pos.1, chute_height, chute_angle, inflate, diff --git a/mods/dr_game/Difficult_Rocket_rs/src/src/lib.rs b/mods/dr_game/Difficult_Rocket_rs/src/src/lib.rs index 5706179..7b1aae1 100644 --- a/mods/dr_game/Difficult_Rocket_rs/src/src/lib.rs +++ b/mods/dr_game/Difficult_Rocket_rs/src/src/lib.rs @@ -15,14 +15,6 @@ mod xml_reader; use pyo3::prelude::*; -enum LoadingState { - Initializing, - WaitingForStart, - PreStarting, - Running, - Cleaning, -} - #[pyfunction] fn get_version_str() -> String { "0.3.0".to_string() @@ -34,9 +26,6 @@ fn test_call(py_obj: &PyAny) -> PyResult { Ok(true) } -/// A Python module implemented in Rust. The name of this function must match -/// the `lib.name` setting in the `Cargo.toml`, else Python will not be able to -/// import the module. #[pymodule] #[pyo3(name = "Difficult_Rocket_rs")] fn module_init(_py: Python<'_>, m: &PyModule) -> PyResult<()> { @@ -54,7 +43,3 @@ fn module_init(_py: Python<'_>, m: &PyModule) -> PyResult<()> { // m.add_class::()?; Ok(()) } - -// pub fn run() {} - -// fn init() {} diff --git a/mods/dr_game/__init__.py b/mods/dr_game/__init__.py index ba4eb02..36c8556 100644 --- a/mods/dr_game/__init__.py +++ b/mods/dr_game/__init__.py @@ -4,7 +4,6 @@ # All rights reserved # ------------------------------- -import warnings import traceback from typing import Optional