aboutsummaryrefslogtreecommitdiffstats
path: root/src/shared/player.rs
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2024-04-08 13:47:18 +0200
committerLibravatar Alexander Foremny <aforemny@posteo.de>2024-04-08 15:23:13 +0200
commit1a559793251e80952bd3bdc668cfda46cbc38e73 (patch)
treea6b2649ac895a75ff48766e24c01202a1ca6a376 /src/shared/player.rs
parentd39c819000569b468cfa68977f8a8b03062ac5d9 (diff)
feat: add player namesmain
Diffstat (limited to 'src/shared/player.rs')
-rw-r--r--src/shared/player.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/shared/player.rs b/src/shared/player.rs
index 606a3b2..f65851d 100644
--- a/src/shared/player.rs
+++ b/src/shared/player.rs
@@ -1,9 +1,17 @@
+use crate::protocol::*;
use crate::shared::activation::*;
use crate::shared::buffs::*;
+use crate::shared::champion::*;
+use crate::shared::cooldown::*;
use crate::shared::faction::*;
+use crate::shared::health::*;
+use crate::shared::imperative::*;
+use crate::shared::name::*;
use crate::shared::shape::*;
use crate::shared::stats::*;
-use crate::shared::*;
+use bevy::prelude::*;
+use lightyear::prelude::*;
+use serde::*;
#[derive(Bundle)]
pub struct PlayerBundle {
@@ -20,11 +28,12 @@ pub struct PlayerBundle {
shape: Shape,
faction: Faction,
player: Player,
+ name: Name_,
replicate: Replicate,
}
impl PlayerBundle {
- pub fn new(id: ClientId, position: Vec2, color: Color) -> Self {
+ pub fn new(id: ClientId, name: String, position: Vec2, color: Color) -> Self {
let mut replicate = Replicate {
replication_group: ReplicationGroup::default().set_priority(10.),
..Default::default()
@@ -53,6 +62,7 @@ impl PlayerBundle {
shape: Shape::player(),
faction: Faction::default(),
player: Player::default(),
+ name: Name_(name),
replicate,
}
}