pub fn lynch(mut self, lynch_target: P) -> State<P> {
        let lynch_id = self.secret_ids.iter().position(|iter_player| &lynch_target == iter_player).expect("lynched player not in game");
        // eliminate impossible gamestates (where the player to be killed by the vote is already dead), then kill voted player
        self.multiverse = self.multiverse.into_iter()
            .filter(|universe| universe.alive[lynch_id])
            .map(|mut universe| {
                universe.kill(lynch_id, false);
                universe
            })
            .collect();
        self.multiverse.collapse_roles();
        // check for game-ending conditions
        if self.multiverse.game_over(false) {
            return State::Complete(Complete::new(self.secret_ids, self.multiverse));
        }
        State::Night(Night {
            secret_ids: self.secret_ids,
            multiverse: self.multiverse,
            last_heals: self.last_heals
        })
    }
/// Advance the game state to the next night by lynching a player.
///
/// See also `no_lynch`.
Advance the game state to the next night by lynching a player.
Advance the game state to the next night by lynching a player .
pub fn lynch(mut self, lynch_target: P) -> State<P> {
        let lynch_id = self.secret_ids.iter().position(|iter_player| &lynch_target == iter_player).expect("lynched player not in game");
        // eliminate impossible gamestates (where the player to be killed by the vote is already dead), then kill voted player
        self.multiverse = self.multiverse.into_iter()
            .filter(|universe| universe.alive[lynch_id])
            .map(|mut universe| {
                universe.kill(lynch_id, false);
                universe
            })
            .collect();
        self.multiverse.collapse_roles();
        // check for game-ending conditions
        if self.multiverse.game_over(false) {
            return State::Complete(Complete::new(self.secret_ids, self.multiverse));
        }
        State::Night(Night {
            secret_ids: self.secret_ids,
            multiverse: self.multiverse,
            last_heals: self.last_heals
        })
    }
pub fn lynch ( mut self , lynch_target : P ) -> State < P > { let lynch_id = self . secret_ids . iter ( ) . position ( | iter_player | & lynch_target == iter_player ) . expect ( " " ) ; // eliminate impossible gamestates (where the player to be killed by the vote is already dead), then kill voted player self . multiverse = self . multiverse . into_iter ( ) . filter ( | universe | universe . alive [ lynch_id ] ) . map ( | mut universe | { universe . kill ( lynch_id , false ) ; universe } ) . collect ( ) ; self . multiverse . collapse_roles ( ) ; // check for game-ending conditions if self . multiverse . game_over ( false ) { return State :: Complete ( Complete :: new ( self . secret_ids , self . multiverse ) ) ; } State :: Night ( Night { secret_ids : self . secret_ids , multiverse : self . multiverse , last_heals : self . last_heals } ) }
Advance the game state to the next night by lynching a player.
Advance the game state to the next night by lynching a player .
mut self
lynch_target
P
mut self
lynch_target
P