2021-02-13 23:32:55 +00:00
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
use specs::Component;
|
|
|
|
|
|
|
|
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
|
|
|
|
pub enum InviteKind {
|
|
|
|
Group,
|
|
|
|
Trade,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
|
|
|
|
pub enum InviteResponse {
|
|
|
|
Accept,
|
|
|
|
Decline,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct Invite {
|
|
|
|
pub inviter: specs::Entity,
|
|
|
|
pub kind: InviteKind,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Component for Invite {
|
2022-08-08 04:38:20 +00:00
|
|
|
type Storage = specs::DenseVecStorage<Self>;
|
2021-02-13 23:32:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// Pending invites that an entity currently has sent out
|
|
|
|
/// (invited entity, instant when invite times out)
|
|
|
|
pub struct PendingInvites(pub Vec<(specs::Entity, InviteKind, std::time::Instant)>);
|
|
|
|
impl Component for PendingInvites {
|
2022-08-08 04:38:20 +00:00
|
|
|
type Storage = specs::DenseVecStorage<Self>;
|
2021-02-13 23:32:55 +00:00
|
|
|
}
|