From ab675360c0005718a3c9b8b5e7962af897269c04 Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Mon, 18 Mar 2024 03:28:49 +0100 Subject: chore: play with network settings --- src/shared.rs | 37 +------------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) (limited to 'src/shared.rs') diff --git a/src/shared.rs b/src/shared.rs index f5a813e..a06ff3e 100644 --- a/src/shared.rs +++ b/src/shared.rs @@ -15,6 +15,7 @@ pub mod cooldown; pub mod health; pub mod health_event; pub mod imperative; +pub mod player; pub mod projectile; pub const KEY: [u8; 32] = [ @@ -23,39 +24,3 @@ pub const KEY: [u8; 32] = [ pub const PLAYER_RADIUS: f32 = 10.; pub const PROTOCOL_ID: u64 = 0; pub const SERVER_PORT: u16 = 16384; - -#[derive(Bundle)] -pub struct PlayerBundle { - id: PlayerId, - position: PlayerPosition, - color: PlayerColor, - replicate: Replicate, - imperative: Imperative, - cooldown: Cooldown, - health: Health, - champion: Champion, -} - -#[derive(Component, Message, Serialize, Deserialize, Clone, Copy, Debug, PartialEq)] -pub struct PlayerId(pub ClientId); - -#[derive(Component, Message, Serialize, Deserialize, Clone, Copy, Debug, PartialEq)] -pub struct PlayerPosition(pub Vec2); - -#[derive(Component, Message, Serialize, Deserialize, Clone, Debug, PartialEq)] -pub struct PlayerColor(pub Color); - -impl PlayerBundle { - pub fn new(id: ClientId, position: Vec2, color: Color) -> Self { - PlayerBundle { - id: PlayerId(id), - position: PlayerPosition(position), - color: PlayerColor(color), - replicate: Replicate::default(), - imperative: Imperative::Idle, - cooldown: Cooldown::default(), - health: Health::default(), - champion: Champion::default(), - } - } -} -- cgit v1.2.3