Added playermetadata struct
This commit is contained in:
parent
cd828ed1b0
commit
9ac42f82e6
|
@ -1,4 +1,5 @@
|
|||
pub mod player;
|
||||
pub mod league;
|
||||
pub mod league_player;
|
||||
pub mod trust;
|
||||
pub mod trust;
|
||||
pub mod player_metadata;
|
|
@ -0,0 +1,20 @@
|
|||
use serde::{Serialize, Deserialize};
|
||||
|
||||
use crate::domain::player::Player;
|
||||
|
||||
|
||||
/// Mainly used for the Chat, so that a user can request and store many players info
|
||||
/// Should be as small as possible to reduce strain on servers and client storage.
|
||||
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, PartialOrd, Ord, Default)]
|
||||
pub struct PlayerMetadata {
|
||||
pub id: u32,
|
||||
pub name: String,
|
||||
pub profile_picture_url: Option<String>,
|
||||
}
|
||||
|
||||
impl From<Player> for PlayerMetadata {
|
||||
fn from(value: Player) -> Self {
|
||||
PlayerMetadata { id: value.id, name: value.name, profile_picture_url: value.profile_picture_url }
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue