aboutsummaryrefslogtreecommitdiffstats
path: root/src/shared/tower.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/tower.rs')
-rw-r--r--src/shared/tower.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/shared/tower.rs b/src/shared/tower.rs
index 5b62b7a..a21048a 100644
--- a/src/shared/tower.rs
+++ b/src/shared/tower.rs
@@ -1,5 +1,6 @@
use crate::shared::activation::*;
use crate::shared::buffs::*;
+use crate::shared::faction::*;
use crate::shared::immovable::*;
use crate::shared::player::*;
use crate::shared::shape::*;
@@ -21,11 +22,12 @@ pub struct TowerBundle {
shape: Shape,
tower: Tower,
immovable: Immovable,
+ faction: Faction,
replicate: Replicate,
}
impl TowerBundle {
- pub fn new(id: ClientId, position: Vec2, color: Color) -> Self {
+ pub fn new(id: ClientId, position: Vec2, faction: Faction) -> Self {
let mut replicate = Replicate {
replication_group: ReplicationGroup::default().set_priority(10.),
..Default::default()
@@ -40,7 +42,7 @@ impl TowerBundle {
TowerBundle {
id: PlayerId(id),
position: PlayerPosition(position),
- color: PlayerColor(color),
+ color: PlayerColor(faction.to_color()),
imperative: Imperative::Idle,
cooldown: Cooldown::default(),
health: Health {
@@ -54,6 +56,7 @@ impl TowerBundle {
shape: Shape::tower(),
tower: Tower::default(),
immovable: Immovable,
+ faction,
replicate,
}
}