pub struct CommitteeBossState {
pub judges: Vec<Judge>,
pub ghost_voting: bool,
pub merged: bool,
pub rng_state: u64,
}Expand description
State for the Committee Boss.
Fields§
§judges: Vec<Judge>§ghost_voting: boolWhether dead judges vote as ghosts.
merged: boolWhether remaining judges have merged (phase 3).
rng_state: u64RNG state for random/chaotic votes.
Implementations§
Source§impl CommitteeBossState
impl CommitteeBossState
pub fn new() -> Self
Sourcepub fn conduct_vote(&mut self, boss_hp_frac: f32) -> CommitteeAction
pub fn conduct_vote(&mut self, boss_hp_frac: f32) -> CommitteeAction
Conduct a vote. All alive judges (and ghosts if enabled) vote. Returns the winning action by majority.
Sourcepub fn alive_count(&self) -> usize
pub fn alive_count(&self) -> usize
Count alive judges.
Sourcepub fn enable_ghost_voting(&mut self)
pub fn enable_ghost_voting(&mut self)
Enable ghost voting (phase 2).
Sourcepub fn merge_judges(&mut self) -> f32
pub fn merge_judges(&mut self) -> f32
Merge remaining judges (phase 3). Returns combined HP.
Trait Implementations§
Source§impl Clone for CommitteeBossState
impl Clone for CommitteeBossState
Source§fn clone(&self) -> CommitteeBossState
fn clone(&self) -> CommitteeBossState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CommitteeBossState
impl Debug for CommitteeBossState
Auto Trait Implementations§
impl Freeze for CommitteeBossState
impl RefUnwindSafe for CommitteeBossState
impl Send for CommitteeBossState
impl Sync for CommitteeBossState
impl Unpin for CommitteeBossState
impl UnsafeUnpin for CommitteeBossState
impl UnwindSafe for CommitteeBossState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.