diff --git a/common/src/comp/body.rs b/common/src/comp/body.rs index 8a893bdcae..4a7b024342 100644 --- a/common/src/comp/body.rs +++ b/common/src/comp/body.rs @@ -198,11 +198,11 @@ impl< const EXTENSION: &'static str = "ron"; } -// Semantic gender aka body_type -// -// Should be used for localization with extreme care. -// For basically everything except *maybe* humanoids, it's simply wrong to -// assume that this may be used as grammatical gender. +/// Semantic gender aka body_type +/// +/// Should be used for localization with extreme care. +/// For basically everything except *maybe* humanoids, it's simply wrong to +/// assume that this may be used as grammatical gender. // // TODO: remove this and instead add GUI for players to choose preferred gender. // Read a comment for `gender_str` in voxygen/i18n-helpers/src/lib.rs. @@ -1366,7 +1366,7 @@ impl Body { } } - // Read comment on `Gender` for more + /// Read comment on `Gender` for more pub fn humanoid_gender(&self) -> Option { match self { Body::Humanoid(b) => match b.body_type { diff --git a/common/src/comp/chat.rs b/common/src/comp/chat.rs index d8017cabda..85aaca755b 100644 --- a/common/src/comp/chat.rs +++ b/common/src/comp/chat.rs @@ -57,6 +57,11 @@ impl ChatMode { pub const fn default() -> Self { Self::World } } +/// Enum representing death types +/// +/// All variants should be strictly typed, no string content. +/// +/// If it's too complicated to create an enum for death type, consult i18n team #[derive(Debug, Clone, Serialize, Deserialize)] pub enum KillType { Buff(BuffKind), @@ -65,18 +70,17 @@ pub enum KillType { Explosion, Energy, Other, - // Projectile(String), TODO: add projectile name when available + // Projectile(Type), TODO: add projectile name when available } +/// Enum representing death reasons +/// +/// All variants should be strictly typed, no string content. #[derive(Debug, Clone, Serialize, Deserialize)] pub enum KillSource { Player(Uid, KillType), NonPlayer(String, KillType), NonExistent(KillType), - // #[deprecated = "if you use it, please expose enum for translators"] - // - // when I say 'enum' I mean it, not just arg to Content. - // Environment(String), FallDamage, Suicide, Other, diff --git a/server/src/chat.rs b/server/src/chat.rs index 747c7b56b1..d268112f54 100644 --- a/server/src/chat.rs +++ b/server/src/chat.rs @@ -17,15 +17,14 @@ pub struct PlayerInfo { alias: String, } +/// Enum representing death reasons +/// +/// All variants should be strictly typed, no string content. #[derive(Clone, Serialize, Deserialize)] pub enum KillSource { Player(PlayerInfo, KillType), NonPlayer(String, KillType), NonExistent(KillType), - // #[deprecated = "if you use it, please expose enum for translators"] - // - // when I say 'enum' I mean it, not just arg to Content. - // Environment(String), FallDamage, Suicide, Other, diff --git a/server/src/client.rs b/server/src/client.rs index a19bf45011..a5852d53c1 100644 --- a/server/src/client.rs +++ b/server/src/client.rs @@ -166,7 +166,7 @@ impl Client { ServerMsg::RegisterAnswer(m) => PreparedMsg::new(0, &m, &self.register_stream_params), ServerMsg::General(g) => { match g { - //Character Screen related + // Character Screen related ServerGeneral::CharacterDataLoadResult(_) | ServerGeneral::CharacterListUpdate(_) | ServerGeneral::CharacterActionError(_) @@ -176,7 +176,7 @@ impl Client { | ServerGeneral::SpectatorSuccess(_) => { PreparedMsg::new(1, &g, &self.character_screen_stream_params) }, - //In-game related + // In-game related ServerGeneral::GroupUpdate(_) | ServerGeneral::Invite { .. } | ServerGeneral::InvitePending(_)