From 897a1dbef67295e66b4a1708d94235e5373d158a Mon Sep 17 00:00:00 2001 From: Sofia Date: Wed, 29 Jul 2026 20:14:14 +0300 Subject: [PATCH] Refactor game_manager to game/mod.rs --- rust/src/bgm.rs | 2 +- rust/src/chat.rs | 2 +- rust/src/cli_parser.rs | 2 +- rust/src/{game_manager.rs => game/mod.rs} | 0 rust/src/goal.rs | 2 +- rust/src/killbox.rs | 2 +- rust/src/lib.rs | 2 +- rust/src/lobby_world.rs | 2 +- rust/src/map.rs | 2 +- rust/src/net/network_manager.rs | 2 +- rust/src/net/protocol.rs | 2 +- rust/src/pickup.rs | 2 +- rust/src/player/local_player.rs | 2 +- rust/src/player/mod.rs | 2 +- rust/src/player/remote_player.rs | 2 +- rust/src/player/weapon.rs | 2 +- rust/src/replay.rs | 2 +- rust/src/ui/chatbox.rs | 2 +- rust/src/ui/game_finished_screen.rs | 2 +- rust/src/ui/hud.rs | 2 +- rust/src/ui/lobby.rs | 2 +- rust/src/ui/lobby_player_listing.rs | 2 +- rust/src/ui/menu_player.rs | 2 +- rust/src/ui/player_listing.rs | 2 +- rust/src/ui/player_listings.rs | 4 +--- rust/src/ui/replay_finished_screen.rs | 2 +- rust/src/ui/simple_score_view.rs | 2 +- 27 files changed, 26 insertions(+), 28 deletions(-) rename rust/src/{game_manager.rs => game/mod.rs} (100%) diff --git a/rust/src/bgm.rs b/rust/src/bgm.rs index 26d1992..825c8a3 100644 --- a/rust/src/bgm.rs +++ b/rust/src/bgm.rs @@ -4,7 +4,7 @@ use godot::{ tools::get_autoload_by_name, }; -use crate::game_manager::GameManager; +use crate::game::GameManager; pub const MUSIC_MANAGER_GLOBAL: &str = "MusicManagerGlobal"; diff --git a/rust/src/chat.rs b/rust/src/chat.rs index 20f9430..d5af6a0 100644 --- a/rust/src/chat.rs +++ b/rust/src/chat.rs @@ -2,7 +2,7 @@ use godot::{classes::RichTextLabel, prelude::*}; use crate::{ announcer::Announcement, - game_manager::{Game, Player}, + game::{Game, Player}, player::DamageSource, }; diff --git a/rust/src/cli_parser.rs b/rust/src/cli_parser.rs index 5192e41..1bbcd13 100644 --- a/rust/src/cli_parser.rs +++ b/rust/src/cli_parser.rs @@ -3,7 +3,7 @@ use std::net::SocketAddr; use godot::{classes::Os, prelude::*}; use crate::{ - game_manager::{Game, GameManager}, + game::{Game, GameManager}, net::network_manager::NetworkManager, }; diff --git a/rust/src/game_manager.rs b/rust/src/game/mod.rs similarity index 100% rename from rust/src/game_manager.rs rename to rust/src/game/mod.rs diff --git a/rust/src/goal.rs b/rust/src/goal.rs index 7331c09..2d2d2a6 100644 --- a/rust/src/goal.rs +++ b/rust/src/goal.rs @@ -3,7 +3,7 @@ use godot::{ prelude::*, }; -use crate::{game_manager::Game, net::network_manager::NetworkManager, player::ball::Ball}; +use crate::{game::Game, net::network_manager::NetworkManager, player::ball::Ball}; #[derive(GodotClass)] #[class(base=Area3D, init)] diff --git a/rust/src/killbox.rs b/rust/src/killbox.rs index 127f42b..9d39ee6 100644 --- a/rust/src/killbox.rs +++ b/rust/src/killbox.rs @@ -5,7 +5,7 @@ use godot::{ use serde::{Deserialize, Serialize}; use crate::{ - game_manager::Game, + game::Game, net::network_manager::NetworkManager, player::{DamageSource, IPlayer, ball::Ball}, }; diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 25c8e48..c9b4d1b 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -5,7 +5,7 @@ pub mod bgm; pub mod chat; pub mod cli_parser; pub mod credits; -pub mod game_manager; +pub mod game; pub mod game_settings; pub mod goal; pub mod killbox; diff --git a/rust/src/lobby_world.rs b/rust/src/lobby_world.rs index b45198d..99f683d 100644 --- a/rust/src/lobby_world.rs +++ b/rust/src/lobby_world.rs @@ -2,7 +2,7 @@ use std::{collections::HashMap, f32::consts::PI}; use godot::{classes::RandomNumberGenerator, prelude::*}; -use crate::{game_manager::Game, ui::menu_player::MenuPlayer}; +use crate::{game::Game, ui::menu_player::MenuPlayer}; #[derive(GodotClass)] #[class(base=Node3D, init)] diff --git a/rust/src/map.rs b/rust/src/map.rs index 29cabea..443a3aa 100644 --- a/rust/src/map.rs +++ b/rust/src/map.rs @@ -3,7 +3,7 @@ use std::collections::HashMap; use godot::{classes::CharacterBody3D, prelude::*}; use crate::{ - game_manager::{Game, GameManager}, + game::{Game, GameManager}, net::util::NetVector3, pickup::Pickup, player::{ diff --git a/rust/src/net/network_manager.rs b/rust/src/net/network_manager.rs index 1b70187..6450793 100644 --- a/rust/src/net/network_manager.rs +++ b/rust/src/net/network_manager.rs @@ -10,7 +10,7 @@ use teanet::{Peer, PeerConfig, PeerMessage}; use crate::{ announcer::Announcement, - game_manager::{Game, GameManager, GameOption, GameOptionValue, NetPlayer}, + game::{Game, GameManager, GameOption, GameOptionValue, NetPlayer}, game_settings::GameSettingsManager, net::{net_stats::Stats, util::NetVector3}, player::{DamageSource, NetTransform, weapon::WeaponType}, diff --git a/rust/src/net/protocol.rs b/rust/src/net/protocol.rs index 01756ba..7ce61d9 100644 --- a/rust/src/net/protocol.rs +++ b/rust/src/net/protocol.rs @@ -4,7 +4,7 @@ use godot::obj::Singleton; use teanet::PeerMessage; use crate::{ - game_manager::{Game, GameManager, GameOption}, + game::{Game, GameManager, GameOption}, game_settings::GameSettingsManager, net::network_manager::{NetworkManager, Package, PeerKind}, popup_queue::{Popup, PopupQueue}, diff --git a/rust/src/pickup.rs b/rust/src/pickup.rs index 67e1031..ada56e9 100644 --- a/rust/src/pickup.rs +++ b/rust/src/pickup.rs @@ -2,7 +2,7 @@ use godot::{classes::Area3D, prelude::*}; use serde::{Deserialize, Serialize}; use crate::{ - game_manager::Game, map::Map, net::network_manager::NetworkManager, player::IPlayer, + game::Game, map::Map, net::network_manager::NetworkManager, player::IPlayer, replay::StandaloneReplayManager, }; diff --git a/rust/src/player/local_player.rs b/rust/src/player/local_player.rs index 88a3295..576998f 100644 --- a/rust/src/player/local_player.rs +++ b/rust/src/player/local_player.rs @@ -10,7 +10,7 @@ use godot::{ }; use crate::{ - game_manager::{Game, GameManager, GameOption}, + game::{Game, GameManager, GameOption}, game_settings::{GameSettings, GameSettingsManager}, killbox::KillboxKind, net::{ diff --git a/rust/src/player/mod.rs b/rust/src/player/mod.rs index 4092142..e96e0cf 100644 --- a/rust/src/player/mod.rs +++ b/rust/src/player/mod.rs @@ -8,7 +8,7 @@ use godot::{ use serde::{Deserialize, Serialize}; use crate::{ - game_manager::{Game, GameOption}, + game::{Game, GameOption}, killbox::KillboxKind, net::{ network_manager::NetworkManager, diff --git a/rust/src/player/remote_player.rs b/rust/src/player/remote_player.rs index be10479..4339a59 100644 --- a/rust/src/player/remote_player.rs +++ b/rust/src/player/remote_player.rs @@ -8,7 +8,7 @@ use godot::{ }; use crate::{ - game_manager::{Game, GameOption}, + game::{Game, GameOption}, killbox::KillboxKind, pickup::PickupKind, player::{ diff --git a/rust/src/player/weapon.rs b/rust/src/player/weapon.rs index c430936..8b8ac7e 100644 --- a/rust/src/player/weapon.rs +++ b/rust/src/player/weapon.rs @@ -7,7 +7,7 @@ use godot::{ use serde::{Deserialize, Serialize}; use crate::{ - game_manager::Game, + game::Game, net::util::{cast_ray, shotgun_ray}, player::{DamageSource, shootable::Shootable}, replay::StandaloneReplayManager, diff --git a/rust/src/replay.rs b/rust/src/replay.rs index 8213ec4..b052693 100644 --- a/rust/src/replay.rs +++ b/rust/src/replay.rs @@ -9,7 +9,7 @@ use godot::{ use serde::{Deserialize, Serialize}; use crate::{ - game_manager::{Game, GameManager, Player}, + game::{Game, GameManager, Player}, game_settings::GameSettingsManager, map::Map, net::{network_manager::BallSync, util::NetVector3}, diff --git a/rust/src/ui/chatbox.rs b/rust/src/ui/chatbox.rs index eb5acd1..c9887c8 100644 --- a/rust/src/ui/chatbox.rs +++ b/rust/src/ui/chatbox.rs @@ -10,7 +10,7 @@ use godot::{ use crate::{ chat::Chat, - game_manager::Game, + game::Game, net::network_manager::{NetworkManager, Package, PeerKind}, ui::cli::CommandLinePanel, }; diff --git a/rust/src/ui/game_finished_screen.rs b/rust/src/ui/game_finished_screen.rs index 7f7c807..e886c31 100644 --- a/rust/src/ui/game_finished_screen.rs +++ b/rust/src/ui/game_finished_screen.rs @@ -4,7 +4,7 @@ use godot::{ }; use crate::{ - game_manager::{Game, GameManager}, + game::{Game, GameManager}, ui::player_listings::PlayerListings, }; diff --git a/rust/src/ui/hud.rs b/rust/src/ui/hud.rs index 424e95a..1ae802c 100644 --- a/rust/src/ui/hud.rs +++ b/rust/src/ui/hud.rs @@ -7,7 +7,7 @@ use godot::{ }; use crate::{ - game_manager::Game, + game::Game, net::network_manager::NetworkManager, ui::{chatbox::ChatBox, cli::CommandLinePanel, settings::SettingsPanel}, }; diff --git a/rust/src/ui/lobby.rs b/rust/src/ui/lobby.rs index 27f1297..09ff120 100644 --- a/rust/src/ui/lobby.rs +++ b/rust/src/ui/lobby.rs @@ -10,7 +10,7 @@ use godot::{ use crate::{ bgm::{Music, MusicManager}, - game_manager::{Game, GameManager, GameOption, GameOptionValue, GameOptions}, + game::{Game, GameManager, GameOption, GameOptionValue, GameOptions}, net::network_manager::{NetworkManager, Package, PeerKind}, ui::lobby_player_listing::LobbyPlayerListing, }; diff --git a/rust/src/ui/lobby_player_listing.rs b/rust/src/ui/lobby_player_listing.rs index 3eda1b1..18cba6e 100644 --- a/rust/src/ui/lobby_player_listing.rs +++ b/rust/src/ui/lobby_player_listing.rs @@ -4,7 +4,7 @@ use godot::{ }; use crate::{ - game_manager::{Game, GameOption, GameOptions}, + game::{Game, GameOption, GameOptions}, net::network_manager::NetworkManager, team_resource::TeamResource, }; diff --git a/rust/src/ui/menu_player.rs b/rust/src/ui/menu_player.rs index 89beac0..8409e54 100644 --- a/rust/src/ui/menu_player.rs +++ b/rust/src/ui/menu_player.rs @@ -3,7 +3,7 @@ use godot::{ prelude::*, }; -use crate::{game_manager::Game, player::soldier_mesh::SoldierMesh}; +use crate::{game::Game, player::soldier_mesh::SoldierMesh}; #[derive(GodotClass)] #[class(base=CharacterBody3D, init)] diff --git a/rust/src/ui/player_listing.rs b/rust/src/ui/player_listing.rs index 3ec2ab3..77f4b1f 100644 --- a/rust/src/ui/player_listing.rs +++ b/rust/src/ui/player_listing.rs @@ -3,7 +3,7 @@ use godot::{ prelude::*, }; -use crate::{game_manager::Game, replay::StandaloneReplayManager}; +use crate::{game::Game, replay::StandaloneReplayManager}; #[derive(GodotClass)] #[class(base=HBoxContainer, init)] diff --git a/rust/src/ui/player_listings.rs b/rust/src/ui/player_listings.rs index 4748c4b..9bc0a30 100644 --- a/rust/src/ui/player_listings.rs +++ b/rust/src/ui/player_listings.rs @@ -4,9 +4,7 @@ use godot::{ prelude::*, }; -use crate::{ - game_manager::Game, replay::StandaloneReplayManager, ui::player_listing::PlayerListing, -}; +use crate::{game::Game, replay::StandaloneReplayManager, ui::player_listing::PlayerListing}; #[derive(GodotClass)] #[class(base=HBoxContainer, init)] diff --git a/rust/src/ui/replay_finished_screen.rs b/rust/src/ui/replay_finished_screen.rs index e390a97..75744b7 100644 --- a/rust/src/ui/replay_finished_screen.rs +++ b/rust/src/ui/replay_finished_screen.rs @@ -4,7 +4,7 @@ use godot::{ }; use crate::{ - game_manager::{Game, GameManager}, + game::{Game, GameManager}, replay::StandaloneReplayManager, ui::player_listings::PlayerListings, }; diff --git a/rust/src/ui/simple_score_view.rs b/rust/src/ui/simple_score_view.rs index 18b16e0..32dda55 100644 --- a/rust/src/ui/simple_score_view.rs +++ b/rust/src/ui/simple_score_view.rs @@ -5,7 +5,7 @@ use godot::{ prelude::*, }; -use crate::{game_manager::Game, replay::StandaloneReplayManager}; +use crate::{game::Game, replay::StandaloneReplayManager}; #[derive(GodotClass)] #[class(base=HBoxContainer, init)]