Refactor code

This commit is contained in:
Sofia 2026-08-06 15:21:02 +03:00
parent 39a5530dec
commit c5d386b755
13 changed files with 17 additions and 21 deletions

View File

@ -14,8 +14,7 @@ use crate::{
commands::{register_commands, unregister_commands}, commands::{register_commands, unregister_commands},
opts::{GameOption, GameOptionValue, GameOptions, PrivateGameOptions, TeamOptions}, opts::{GameOption, GameOptionValue, GameOptions, PrivateGameOptions, TeamOptions},
}, },
map::Map, map::{Map, map_resource::MapResource, pickup::PickupKind},
map_resource::MapResource,
net::{ net::{
network_manager::{ network_manager::{
BallSync, NetworkManager, BallSync, NetworkManager,
@ -26,7 +25,6 @@ use crate::{
}, },
util::NetVector3, util::NetVector3,
}, },
pickup::PickupKind,
player::{ player::{
DamageSource, IPlayer, NetTransform, DamageSource, IPlayer, NetTransform,
ball::Ball, ball::Ball,

View File

@ -8,14 +8,9 @@ pub mod cli_parser;
pub mod credits; pub mod credits;
pub mod game; pub mod game;
pub mod game_settings; pub mod game_settings;
pub mod goal;
pub mod killbox;
pub mod lobby_world; pub mod lobby_world;
pub mod map; pub mod map;
pub mod map_resource;
pub mod map_static;
pub mod net; pub mod net;
pub mod pickup;
pub mod player; pub mod player;
pub mod popup_queue; pub mod popup_queue;
pub mod replay; pub mod replay;

View File

@ -4,9 +4,7 @@ use godot::{classes::RandomNumberGenerator, prelude::*};
use crate::{ use crate::{
game::{Game, GameManager}, game::{Game, GameManager},
map::Map, map::map_static::StaticMap,
map_resource::MapResource,
map_static::StaticMap,
player::menu_player::MenuPlayer, player::menu_player::MenuPlayer,
ui::lobby::LobbyPanel, ui::lobby::LobbyPanel,
}; };

View File

@ -4,8 +4,8 @@ use godot::{classes::CharacterBody3D, prelude::*};
use crate::{ use crate::{
game::{Game, GameManager}, game::{Game, GameManager},
map::pickup::Pickup,
net::util::NetVector3, net::util::NetVector3,
pickup::Pickup,
player::{ player::{
IPlayer, NetTransform, ball::Ball, local_player::LocalPlayer, remote_player::RemotePlayer, IPlayer, NetTransform, ball::Ball, local_player::LocalPlayer, remote_player::RemotePlayer,
telegrenade::Telegrenade, telegrenade::Telegrenade,
@ -13,6 +13,12 @@ use crate::{
replay::{ReplayPlayer, ReplayPlayerState, StandaloneReplayManager}, replay::{ReplayPlayer, ReplayPlayerState, StandaloneReplayManager},
}; };
pub mod goal;
pub mod killbox;
pub mod map_resource;
pub mod map_static;
pub mod pickup;
#[derive(GodotClass)] #[derive(GodotClass)]
#[class(base=Node3D, init)] #[class(base=Node3D, init)]
pub struct Map { pub struct Map {

View File

@ -12,7 +12,7 @@ use godot::{
use crate::{ use crate::{
game::{Game, GameManager, opts::GameOption}, game::{Game, GameManager, opts::GameOption},
game_settings::{GameSettings, GameSettingsManager}, game_settings::{GameSettings, GameSettingsManager},
killbox::KillboxKind, map::{killbox::KillboxKind, pickup::PickupKind},
net::{ net::{
network_manager::{ network_manager::{
NetworkManager, NetworkManager,
@ -21,7 +21,6 @@ use crate::{
}, },
util::cast_ray, util::cast_ray,
}, },
pickup::PickupKind,
player::{ player::{
DamageSource, DamageSourceSignal, IPlayer, NetTransform, PlayerCommon, DamageSource, DamageSourceSignal, IPlayer, NetTransform, PlayerCommon,
buffs::{Buff, Buffs}, buffs::{Buff, Buffs},

View File

@ -9,12 +9,11 @@ use serde::{Deserialize, Serialize};
use crate::{ use crate::{
game::{Game, opts::GameOption}, game::{Game, opts::GameOption},
killbox::KillboxKind, map::{killbox::KillboxKind, pickup::PickupKind},
net::{ net::{
network_manager::NetworkManager, network_manager::NetworkManager,
util::{NetVector3, shotgun_ray}, util::{NetVector3, shotgun_ray},
}, },
pickup::PickupKind,
player::{ player::{
buffs::{Buff, Buffs}, buffs::{Buff, Buffs},
shootable::Shootable, shootable::Shootable,

View File

@ -9,8 +9,7 @@ use godot::{
use crate::{ use crate::{
game::{Game, opts::GameOption}, game::{Game, opts::GameOption},
killbox::KillboxKind, map::{killbox::KillboxKind, pickup::PickupKind},
pickup::PickupKind,
player::{ player::{
DamageSource, DamageSourceSignal, IPlayer, NetTransform, PlayerCommon, DamageSource, DamageSourceSignal, IPlayer, NetTransform, PlayerCommon,
buffs::{Buff, Buffs}, buffs::{Buff, Buffs},

View File

@ -8,15 +8,17 @@ use std::{
}; };
use flate2::{Compression, bufread::GzDecoder, write::GzEncoder}; use flate2::{Compression, bufread::GzDecoder, write::GzEncoder};
use godot::{ prelude::*, tools::get_autoload_by_name}; use godot::{prelude::*, tools::get_autoload_by_name};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use crate::{ use crate::{
game::{Game, GameManager, Player, PlayerStats}, game::{Game, GameManager, Player, PlayerStats},
game_settings::GameSettingsManager, game_settings::GameSettingsManager,
map::Map, map::{
net::{network_manager::BallSync, util::NetVector3}, Map,
pickup::{PickupKind, ReplayVisibility}, pickup::{PickupKind, ReplayVisibility},
},
net::{network_manager::BallSync, util::NetVector3},
player::{ player::{
DamageSource, IPlayer, NetTransform, ball::Ball, buffs::Buffs, remote_player::RemotePlayer, DamageSource, IPlayer, NetTransform, ball::Ball, buffs::Buffs, remote_player::RemotePlayer,
telegrenade::Telegrenade, weapon::WeaponType, telegrenade::Telegrenade, weapon::WeaponType,