veloren_common/comp/
invite.rs

1use serde::{Deserialize, Serialize};
2use specs::Component;
3
4#[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
5pub enum InviteKind {
6    Group,
7    Trade,
8}
9
10#[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
11pub enum InviteResponse {
12    Accept,
13    Decline,
14}
15
16pub struct Invite {
17    pub inviter: specs::Entity,
18    pub kind: InviteKind,
19}
20
21impl Component for Invite {
22    type Storage = specs::DenseVecStorage<Self>;
23}
24
25/// Pending invites that an entity currently has sent out
26/// (invited entity, instant when invite times out)
27pub struct PendingInvites(pub Vec<(specs::Entity, InviteKind, std::time::Instant)>);
28impl Component for PendingInvites {
29    type Storage = specs::DenseVecStorage<Self>;
30}