summaryrefslogtreecommitdiff
path: root/game_server/src/group.rs
diff options
context:
space:
mode:
Diffstat (limited to 'game_server/src/group.rs')
-rw-r--r--game_server/src/group.rs19
1 files changed, 17 insertions, 2 deletions
diff --git a/game_server/src/group.rs b/game_server/src/group.rs
index 3241eee..9774979 100644
--- a/game_server/src/group.rs
+++ b/game_server/src/group.rs
@@ -1,7 +1,22 @@
-struct Group {
- id: u32,
+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)});
+ }
}