Trait twt_werewolf_master_ng::judger::roles::RoleGroup

source ·
pub trait RoleGroup {
    // Provided methods
    fn day(&self, _players: Vec<&'_ mut Box<dyn Responder>>) { ... }
    fn night(&self, _players: Vec<&'_ mut Box<dyn Responder>>, _log: &mut Log) { ... }
    fn death(
        &self,
        players: Vec<&'_ mut Box<dyn Responder>>,
        dying: &mut Box<dyn Responder>,
        log: &mut Log
    ) { ... }
}
Expand description

实现角色行为的特型。注意,服务器死亡判断时创建了新对象,谨慎在角色组对象中存储数据。

Provided Methods§

source

fn day(&self, _players: Vec<&'_ mut Box<dyn Responder>>)

source

fn night(&self, _players: Vec<&'_ mut Box<dyn Responder>>, _log: &mut Log)

source

fn death( &self, players: Vec<&'_ mut Box<dyn Responder>>, dying: &mut Box<dyn Responder>, log: &mut Log )

角色一个个死,死亡判断被一个个传给每个角色组。

  • 遗言需要广播给所有人,players 需要传入所有人。
  • dying 是需要进行死亡判断的玩家。

Implementors§