From c293376bd8d98629a7c5de9e38cd4c7fc7d0d8c5 Mon Sep 17 00:00:00 2001 From: Han GyoungSu Date: Sun, 8 Dec 2024 03:13:02 +0900 Subject: [PATCH] feat: add allow(dead_code) attributes to game cache module --- src/game_cache.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/game_cache.rs b/src/game_cache.rs index 6cfc4cc..fcb0c53 100644 --- a/src/game_cache.rs +++ b/src/game_cache.rs @@ -86,7 +86,7 @@ pub trait ClientTrait: Debug { } /// Represents the result of processing a frame. -#[derive(Debug)] +#[allow(dead_code)] pub struct FrameResult { pub frame_index: usize, pub use_cache: bool, @@ -109,6 +109,7 @@ pub struct GameDataProcessor { } impl GameDataProcessor { + #[allow(dead_code)] /// Creates a new GameDataProcessor with no clients. pub fn new() -> Self { Self { @@ -119,11 +120,13 @@ impl GameDataProcessor { } } + #[allow(dead_code)] /// Adds a new client to the processor. fn add_client(&mut self, client_id: u32, client: Box) { self.clients.insert(client_id, client); } + #[allow(dead_code)] /// Processes incoming game data from a client. /// Stores the data in the client's pending inputs. fn process_incoming(&mut self, client_id: u32, data: Vec) { @@ -131,6 +134,7 @@ impl GameDataProcessor { client.handle_incoming(data); } + #[allow(dead_code)] /// Processes a frame if inputs from all clients are available. /// Returns Some(FrameResult) if the frame was processed. pub fn process_frame(&mut self) -> Option { @@ -168,6 +172,7 @@ impl GameDataProcessor { Some(frame_result) } + #[allow(dead_code)] /// Prepares outgoing game data to send to clients. pub fn prepare_outgoing(&mut self, data: Vec) -> (bool, u8, Vec) { if let Some(pos) = self.aggregated_cache.find(&data) {