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.rs22
1 files changed, 4 insertions, 18 deletions
diff --git a/game_server/src/group.rs b/game_server/src/group.rs
index 9774979..55e4fbf 100644
--- a/game_server/src/group.rs
+++ b/game_server/src/group.rs
@@ -1,22 +1,8 @@
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 trait Group {
+ fn id(&self) -> GroupId;
+ fn name(&self) -> String;
- pub fn run(&self) {
- let id = self.id;
- std::thread::spawn(move ||
- loop {println!("group id: {} meldet sich", id)});
- }
+ fn run(&self);
}