From 49192dbb98e0ab1f2a66b4786fac86d63f69be64 Mon Sep 17 00:00:00 2001 From: "1992414357@qq.com" <1992414357@qq.com> Date: Mon, 9 Jun 2025 01:44:36 +0800 Subject: 重构所有部分 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/data/game/structs.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 core/src/data/game/structs.rs (limited to 'core/src/data/game/structs.rs') diff --git a/core/src/data/game/structs.rs b/core/src/data/game/structs.rs new file mode 100644 index 0000000..52fc0f1 --- /dev/null +++ b/core/src/data/game/structs.rs @@ -0,0 +1,29 @@ +use std::collections::HashMap; +use serde::{Deserialize, Serialize}; +use crate::data::game::types::GameInfo; +use crate::data::player::structs::Account; + +/// Game pad_client data +/// Describes the basic information of the game pad_client +#[derive(Clone, Serialize, Deserialize, PartialEq, Debug)] +pub struct GameData { + pub info: GameInfo, + pub control: GameControlData, + pub archive: GameRuntimeDataArchive +} + +/// Game control information +/// Describes the buttons, axes, and directions that can be controlled. +#[derive(Default, Clone, Serialize, Deserialize, PartialEq, Debug)] +pub struct GameControlData { + pub direction_keys : HashMap, + pub axis_keys : HashMap, + pub button_keys : HashMap, +} + +/// Archive of game runtime data +/// The game pad_client can convert data into this structure for persistence. +#[derive(Default, Clone, Serialize, Deserialize, PartialEq, Debug)] +pub struct GameRuntimeDataArchive { + pub banned: Vec +} \ No newline at end of file -- cgit