feat(demo mode): allow for random color assignments

This commit is contained in:
2026-01-02 17:26:30 -05:00
Unverified
parent 2b1ff2f98b
commit 8ad6b0868d
4 changed files with 98 additions and 53 deletions

View File

@@ -1,16 +1,28 @@
use rand::Rng;
use std::net::SocketAddr;
use std::vec;
use std::{ops, vec};
use tokio::sync::mpsc::UnboundedSender;
use tokio_tungstenite::tungstenite::Message;
#[derive(PartialEq, Clone)]
#[derive(PartialEq, Clone, Copy)]
pub enum Color {
Red,
Yellow,
None,
}
impl ops::Not for Color {
type Output = Color;
fn not(self) -> Color {
match self {
Color::Red => Color::Yellow,
Color::Yellow => Color::Red,
Color::None => Color::None,
}
}
}
#[derive(Clone)]
pub struct Client {
pub username: String,