remove "dealer" user
authorGeoffrey Allott <geoffrey@allott.email>
Sun, 14 Mar 2021 22:24:49 +0000 (22:24 +0000)
committerGeoffrey Allott <geoffrey@allott.email>
Sun, 14 Mar 2021 22:24:49 +0000 (22:24 +0000)
src/game/chatroom.rs
src/username.rs

index ea1934695fe90c175957668d30668e23cfb0ce6d..4b10a5acefeebe6f667a239c0f8544922a5d5db1 100644 (file)
@@ -1,7 +1,7 @@
 use std::collections::HashSet;
 
 use crate::game::{Action, ActionError, DealerAction};
-use crate::username::{Username, DEALER};
+use crate::username::Username;
 use crate::util::timestamp::Timestamp;
 
 use super::ValidatedUserAction;
@@ -91,14 +91,7 @@ impl Game for Chatroom {
         }
     }
 
-    fn next_dealer_action(&self, timestamp: Timestamp) -> DealerAction {
-        match self.messages.len() {
-            n if n % 10 == 0 => DealerAction::TakeAction(ValidatedUserAction(UserAction {
-                timestamp,
-                username: DEALER,
-                action: Action::Message { message: format!("{} messages posted so far", n) },
-            })),
-            _ => DealerAction::WaitForPlayer,
-        }
+    fn next_dealer_action(&self, _: Timestamp) -> DealerAction {
+        DealerAction::Leave
     }
 }
index b505c74685529ac1af775600d9b5f2dcfefa69dc..9bc9e5d4d97de0ae5cc7019aa6a462045fce1805 100644 (file)
@@ -22,9 +22,6 @@ impl Username {
     }
 }
 
-pub const DEALER: Username =
-    Username { username: [b'd', b'e', b'a', b'l', b'e', b'r', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] };
-
 impl Display for Username {
     fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
         match self.as_str() {