aboutsummaryrefslogtreecommitdiffstats
path: root/src/protocol.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/protocol.rs
parentd39c819000569b468cfa68977f8a8b03062ac5d9 (diff)
feat: add player namesmain
Diffstat (limited to 'src/protocol.rs')
-rw-r--r--src/protocol.rs15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/protocol.rs b/src/protocol.rs
index f75cfab..bdc2098 100644
--- a/src/protocol.rs
+++ b/src/protocol.rs
@@ -7,12 +7,12 @@ use crate::shared::faction::*;
use crate::shared::health::*;
use crate::shared::health_event::*;
use crate::shared::imperative::*;
+use crate::shared::name::*;
use crate::shared::player::*;
use crate::shared::projectile::*;
use crate::shared::shape::*;
use crate::shared::stats::*;
use crate::shared::tower::*;
-use bevy::prelude::*;
use lightyear::prelude::*;
use serde::Deserialize;
use serde::Serialize;
@@ -24,18 +24,18 @@ pub enum Inputs {
impl UserAction for Inputs {}
#[derive(Message, Serialize, Deserialize, Clone, Debug, PartialEq)]
-pub struct SelectChampion(pub Champion);
-
-#[derive(Message, Serialize, Deserialize, Clone, Debug, PartialEq)]
-pub struct SelectFaction(pub Faction);
+pub struct Spawn {
+ pub champion: Champion,
+ pub faction: Faction,
+ pub name: String,
+}
#[derive(Message, Serialize, Deserialize, Clone, Debug, PartialEq)]
pub struct HealthChanged(pub HealthEvent);
#[message_protocol(protocol = "MyProtocol")]
pub enum Messages {
- SelectChampion(SelectChampion),
- SelectFaction(SelectFaction),
+ Spawn(Spawn),
HealthChanged(HealthChanged),
Imperative(Imperative),
Activation(Activation),
@@ -57,6 +57,7 @@ pub enum Components {
Shape(Shape),
Tower(Tower),
Faction(Faction),
+ Name(Name_),
}
#[derive(Channel)]