1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use super::{comm::{vote, Client, Message}, pause};

pub struct Werewolf { }

impl super::Role for Werewolf {
    fn born(&self, id: u64, username: String)  {
        println!("{}({} 号)你的角色是 狼人。", username, id);
    }
    fn night(&self, cli: &mut Client) {
        loop {
            let msg = cli.receive();
            match msg {
                Message::Begin => vote(cli),
                Message::Text(s) => println!("{s:}"),
                Message::End => break,
                _ => panic!("night"),
            }
        }
        let _night_over = cli.rec();
        pause();
    }
}

impl Werewolf {
    pub fn new() -> Self { Werewolf {} }
}