1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use serde::{Deserialize, Serialize};
use specs::Component;

#[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum InviteKind {
    Group,
    Trade,
}

#[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum InviteResponse {
    Accept,
    Decline,
}

pub struct Invite {
    pub inviter: specs::Entity,
    pub kind: InviteKind,
}

impl Component for Invite {
    type Storage = specs::DenseVecStorage<Self>;
}

/// 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 {
    type Storage = specs::DenseVecStorage<Self>;
}