From dc2e4e09a8ce9fdabc958f4f2d2ef75ba872521c Mon Sep 17 00:00:00 2001 From: Bergmann89 Date: Wed, 6 Jan 2021 12:46:58 +0100 Subject: [PATCH] Renamed 'Owned' to 'PlayerOwned' --- space-crush-common/src/components/mod.rs | 2 +- space-crush-common/src/components/player.rs | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/space-crush-common/src/components/mod.rs b/space-crush-common/src/components/mod.rs index 1d1bd8c..d28c483 100644 --- a/space-crush-common/src/components/mod.rs +++ b/space-crush-common/src/components/mod.rs @@ -13,7 +13,7 @@ pub use fleet::{Fleet, FleetOwned}; pub use meeting_point::{MeetingPoint, MeetingPointOwned}; pub use obstacle::Obstacle; pub use planet::Planet; -pub use player::{Owned as PlayerOwned, Player}; +pub use player::{Player, PlayerOwned}; pub use position::{Position, Shape}; pub use ship::{Count as ShipCount, Obstacle as ShipObstacle, Ship, Type as ShipType}; pub use velocity::Velocity; diff --git a/space-crush-common/src/components/player.rs b/space-crush-common/src/components/player.rs index f9c7f29..c9af4d9 100644 --- a/space-crush-common/src/components/player.rs +++ b/space-crush-common/src/components/player.rs @@ -13,12 +13,12 @@ pub struct Player { } #[derive(Copy, Clone, Debug)] -pub struct Owned { +pub struct PlayerOwned { owner: Entity, } #[derive(Serialize, Deserialize)] -pub struct OwnedData { +pub struct PlayerOwnedData { pub owner: M, } @@ -46,7 +46,7 @@ impl Component for Player { type Storage = HashMapStorage; } -impl Owned { +impl PlayerOwned { pub fn new(owner: Entity) -> Self { Self { owner } } @@ -56,15 +56,15 @@ impl Owned { } } -impl Component for Owned { +impl Component for PlayerOwned { type Storage = HashMapStorage; } -impl ConvertSaveload for Owned +impl ConvertSaveload for PlayerOwned where for<'de> M: Marker + Serialize + Deserialize<'de>, { - type Data = OwnedData; + type Data = PlayerOwnedData; type Error = NoError; fn convert_into(&self, mut ids: F) -> Result @@ -73,7 +73,7 @@ where { let owner = ids(self.owner).unwrap(); - Ok(OwnedData { owner }) + Ok(PlayerOwnedData { owner }) } fn convert_from(data: Self::Data, mut ids: F) -> Result @@ -82,7 +82,7 @@ where { let owner = ids(data.owner).unwrap(); - Ok(Owned { owner }) + Ok(PlayerOwned { owner }) } }