lodestone-parser/src/models/linkshell.rs

37 lines
923 B
Rust
Raw Normal View History

2018-10-28 21:29:54 +00:00
use super::search::{Paginated, character::CharacterSearchItem};
use ffxiv_types::World;
2022-06-16 14:10:03 +00:00
#[cfg(feature = "with_serde")] use serde::{Deserialize, Serialize};
2018-10-28 21:29:54 +00:00
#[derive(Debug)]
#[cfg_attr(feature = "with_serde", derive(Deserialize, Serialize))]
2018-10-28 21:29:54 +00:00
pub struct Linkshell {
#[cfg_attr(feature = "with_serde", serde(with = "crate::util::serde::u64_str"))]
2018-10-28 21:29:54 +00:00
pub id: u64,
pub name: String,
pub world: World,
pub active_members: u8,
pub members: Paginated<LinkshellMember>,
}
#[derive(Debug)]
#[cfg_attr(feature = "with_serde", derive(Deserialize, Serialize))]
2018-10-28 21:29:54 +00:00
pub struct LinkshellMember {
#[cfg_attr(feature = "with_serde", serde(flatten))]
2018-10-28 21:29:54 +00:00
pub character: CharacterSearchItem,
pub role: Option<Role>,
}
2018-10-31 13:01:46 +00:00
impl std::ops::Deref for LinkshellMember {
type Target = CharacterSearchItem;
fn deref(&self) -> &Self::Target {
&self.character
}
}
2018-10-28 21:29:54 +00:00
ffxiv_enum!(Role {
Master => "master",
Leader => "leader",
});