pub struct Judge {
pub id: u32,
pub personality: JudgePersonality,
pub hp: f32,
pub max_hp: f32,
pub alive: bool,
pub ghost: bool,
pub voting: bool,
pub current_vote: Option<CommitteeAction>,
}Expand description
A single judge in the Committee boss.
Fields§
§id: u32§personality: JudgePersonality§hp: f32§max_hp: f32§alive: bool§ghost: boolDead judges become ghosts that still vote (phase 2+).
voting: boolWhether this judge is currently lit up (voting).
current_vote: Option<CommitteeAction>The action this judge voted for.
Implementations§
Source§impl Judge
impl Judge
pub fn new(id: u32, personality: JudgePersonality, hp: f32) -> Self
Sourcepub fn cast_vote(&mut self, boss_hp_frac: f32, rng_val: u64) -> CommitteeAction
pub fn cast_vote(&mut self, boss_hp_frac: f32, rng_val: u64) -> CommitteeAction
Cast a vote based on personality and context.
Sourcepub fn take_damage(&mut self, amount: f32) -> bool
pub fn take_damage(&mut self, amount: f32) -> bool
Take damage. Returns true if killed.
Sourcepub fn become_ghost(&mut self)
pub fn become_ghost(&mut self)
Convert to ghost (phase 2).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Judge
impl RefUnwindSafe for Judge
impl Send for Judge
impl Sync for Judge
impl Unpin for Judge
impl UnsafeUnpin for Judge
impl UnwindSafe for Judge
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.