summaryrefslogtreecommitdiff
path: root/game_server/src/group.rs
diff options
context:
space:
mode:
authornatrixaeria <janng@gmx.de>2019-05-11 06:26:26 +0200
committernatrixaeria <janng@gmx.de>2019-05-11 06:26:26 +0200
commit73eb78e3ac5eb7d382c1aca98da84cd866d54570 (patch)
tree92fb23c91eb812adfc6769e139537758d5002b4e /game_server/src/group.rs
parente2d83e09f8af95c82385967f61e2ec8342a4b2c9 (diff)
Create a fundamental project structure
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)});
+ }
}