summaryrefslogtreecommitdiff
path: root/game_server/src/group.rs
blob: 97749797f6fa0581844689ea5d54c55e98ffb5ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
pub type GroupId = u32;

pub struct Group {
    id: GroupId,
    name: String,
}

impl Group {
    pub(crate) fn new(id: GroupId, name: String) -> Group {
        Group { id, name }
    }

    pub(crate) fn get_id(&self) -> GroupId {
        self.id
    }

    pub fn run(&self) {
        let id = self.id;
        std::thread::spawn(move ||
            loop {println!("group id: {} meldet sich", id)});
    }
}