diff options
Diffstat (limited to 'src-tauri/src/launcher')
| -rw-r--r-- | src-tauri/src/launcher/config.rs | 13 | ||||
| -rw-r--r-- | src-tauri/src/launcher/launcher.rs | 15 | ||||
| -rw-r--r-- | src-tauri/src/launcher/mod.rs | 19 |
3 files changed, 47 insertions, 0 deletions
diff --git a/src-tauri/src/launcher/config.rs b/src-tauri/src/launcher/config.rs new file mode 100644 index 0000000..fafc229 --- /dev/null +++ b/src-tauri/src/launcher/config.rs @@ -0,0 +1,13 @@ +pub struct Config { + pub username: String, + pub resolution: (u32, u32), +} + +impl Config { + pub fn new(username: &str, resolution: (u32, u32)) -> Self { + Config { + username: username.to_string(), + resolution, + } + } +}
\ No newline at end of file diff --git a/src-tauri/src/launcher/launcher.rs b/src-tauri/src/launcher/launcher.rs new file mode 100644 index 0000000..5ccf443 --- /dev/null +++ b/src-tauri/src/launcher/launcher.rs @@ -0,0 +1,15 @@ +pub struct Launcher { + pub config: crate::launcher::config::Config, +} + +impl Launcher { + pub fn new(config: crate::launcher::config::Config) -> Self { + Launcher { config } + } + + pub fn launch(&self) { + // 启动游戏的逻辑 + println!("启动游戏,用户名: {}", self.config.username); + println!("分辨率: {}x{}", self.config.resolution.0, self.config.resolution.1); + } +}
\ No newline at end of file diff --git a/src-tauri/src/launcher/mod.rs b/src-tauri/src/launcher/mod.rs new file mode 100644 index 0000000..0359d3e --- /dev/null +++ b/src-tauri/src/launcher/mod.rs @@ -0,0 +1,19 @@ +pub mod config; +pub mod launcher; + +pub use config::Config; +pub use launcher::Launcher; + +pub fn start() { + // 启动器的代码 + println!("启动器启动中..."); + + // 创建配置 + let config = Config::new("玩家", (1920, 1080)); + + // 创建启动器 + let launcher = Launcher::new(config); + + // 启动游戏 + launcher.launch(); +}
\ No newline at end of file |