Struct byregot::simulator::CraftState
source · pub struct CraftState {Show 16 fields
pub step_num: u32,
pub progress: u32,
pub max_progress: u32,
pub quality: u32,
pub max_quality: u32,
pub durability: i32,
pub max_durability: u32,
pub cp: u32,
pub max_cp: u32,
pub gear_effects: GearEffects,
pub buffs: BuffStacks,
pub did_observe: bool,
pub prev_basic_touch_combo: u8,
pub basic_touch_combo: u8,
pub step_state: StepState,
pub next_success_rng: f32,
/* private fields */
}
Fields§
§step_num: u32
§progress: u32
§max_progress: u32
§quality: u32
§max_quality: u32
§durability: i32
§max_durability: u32
§cp: u32
§max_cp: u32
§gear_effects: GearEffects
§buffs: BuffStacks
§did_observe: bool
§prev_basic_touch_combo: u8
§basic_touch_combo: u8
§step_state: StepState
§next_success_rng: f32
Implementations§
source§impl CraftState
impl CraftState
sourcepub fn set_next_step_outcome(&mut self, success_rng: f32, state: StepState)
pub fn set_next_step_outcome(&mut self, success_rng: f32, state: StepState)
set_next_state_outcome sets the success and/or StepState of the next step. if success_rng is less than the success threshold for the next action, step will succeed. Each step will automatically reset the next step to be successful with a NORMAL StepState.
pub fn step_num(&self) -> i64
pub fn is_finished(&self) -> bool
sourcepub fn get_valid_action_mask(&self) -> [bool; 30]
pub fn get_valid_action_mask(&self) -> [bool; 30]
get_valid_action_mask returns a bool mask of valid actions for the next step, where “true” means valid.
sourcepub fn play_action_no_validate(&mut self, action_id: ActionID)
pub fn play_action_no_validate(&mut self, action_id: ActionID)
play_action_no_validate makes no attempt to validate the action; it should be checked beforehand
sourcepub fn play_action(&mut self, action_id: ActionID) -> bool
pub fn play_action(&mut self, action_id: ActionID) -> bool
play_action returns true if the action was validated and executed. False otherwise.
pub fn set_next_state_rng(&mut self)
Trait Implementations§
source§impl Clone for CraftState
impl Clone for CraftState
source§fn clone(&self) -> CraftState
fn clone(&self) -> CraftState
Returns a copy 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 CraftState
impl Debug for CraftState
source§impl Hash for CraftState
impl Hash for CraftState
source§impl PartialEq<CraftState> for CraftState
impl PartialEq<CraftState> for CraftState
impl Copy for CraftState
impl Eq for CraftState
Auto Trait Implementations§
impl RefUnwindSafe for CraftState
impl Send for CraftState
impl Sync for CraftState
impl Unpin for CraftState
impl UnwindSafe for CraftState
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