pub struct InteractiveMode {
pub current_mode: ApplicationMode,
pub config_focus: Option<ConfigurationField>,
pub array_view_algorithm: usize,
pub help_visible: bool,
/* private fields */
}
Expand description
Interactive mode state management
Fields§
§current_mode: ApplicationMode
Current application mode
config_focus: Option<ConfigurationField>
Current configuration focus (None means main menu)
array_view_algorithm: usize
Currently selected algorithm for array visualization
help_visible: bool
Whether help overlay is visible
Implementations§
Source§impl InteractiveMode
impl InteractiveMode
Sourcepub fn get_current_config(&self) -> &ConfigurationState
pub fn get_current_config(&self) -> &ConfigurationState
Get current configuration
Sourcepub fn set_config(&mut self, config: ConfigurationState)
pub fn set_config(&mut self, config: ConfigurationState)
Set configuration
Sourcepub fn is_configuration_mode(&self) -> bool
pub fn is_configuration_mode(&self) -> bool
Check if currently in configuration mode
Sourcepub fn is_race_active(&self) -> bool
pub fn is_race_active(&self) -> bool
Check if race is currently active
Sourcepub fn is_race_paused(&self) -> bool
pub fn is_race_paused(&self) -> bool
Check if race is paused
Sourcepub fn is_race_complete(&self) -> bool
pub fn is_race_complete(&self) -> bool
Check if race is complete
Sourcepub fn is_race_timer_active(&self) -> bool
pub fn is_race_timer_active(&self) -> bool
Check if race timer is active
Sourcepub fn is_race_timer_paused(&self) -> bool
pub fn is_race_timer_paused(&self) -> bool
Check if race timer is paused
Check if menu is currently visible
Sourcepub fn should_show_help_overlay(&self) -> bool
pub fn should_show_help_overlay(&self) -> bool
Check if help overlay should be shown
Sourcepub fn should_update_display(&self) -> bool
pub fn should_update_display(&self) -> bool
Check if display needs update
Sourcepub fn has_selection_changed(&self) -> bool
pub fn has_selection_changed(&self) -> bool
Check if selection has changed (for visual feedback)
Sourcepub fn is_error_message_visible(&self) -> bool
pub fn is_error_message_visible(&self) -> bool
Check if error message is visible
Sourcepub fn get_error_message(&self) -> Option<&str>
pub fn get_error_message(&self) -> Option<&str>
Get current error message
Sourcepub fn clear_error_message(&mut self)
pub fn clear_error_message(&mut self)
Clear error message
Sourcepub fn set_error_message(&mut self, message: String)
pub fn set_error_message(&mut self, message: String)
Set error message
Sourcepub fn get_race_elapsed_time(&self) -> Option<Duration>
pub fn get_race_elapsed_time(&self) -> Option<Duration>
Get race elapsed time
Sourcepub fn get_race_start_time(&self) -> Option<Instant>
pub fn get_race_start_time(&self) -> Option<Instant>
Get race start time
Sourcepub fn transition_to_configuration(&mut self) -> Result<()>
pub fn transition_to_configuration(&mut self) -> Result<()>
Transition to Configuration mode
Sourcepub fn transition_to_racing(&mut self) -> Result<()>
pub fn transition_to_racing(&mut self) -> Result<()>
Transition to Racing mode
Sourcepub fn transition_to_paused(&mut self) -> Result<()>
pub fn transition_to_paused(&mut self) -> Result<()>
Transition to Paused mode
Sourcepub fn transition_to_complete(&mut self) -> Result<()>
pub fn transition_to_complete(&mut self) -> Result<()>
Transition to Complete mode
Sourcepub fn set_config_focus(&mut self, field: ConfigurationField) -> Result<()>
pub fn set_config_focus(&mut self, field: ConfigurationField) -> Result<()>
Set configuration focus
Sourcepub fn clear_config_focus(&mut self)
pub fn clear_config_focus(&mut self)
Clear configuration focus (return to main menu)
Sourcepub fn toggle_help(&mut self)
pub fn toggle_help(&mut self)
Toggle help visibility
Sourcepub fn set_array_view_algorithm(&mut self, algorithm_index: usize)
pub fn set_array_view_algorithm(&mut self, algorithm_index: usize)
Set array view algorithm
Sourcepub fn cycle_array_view_algorithm(&mut self, algorithm_count: usize)
pub fn cycle_array_view_algorithm(&mut self, algorithm_count: usize)
Cycle to next array view algorithm
Sourcepub fn mark_display_updated(&mut self)
pub fn mark_display_updated(&mut self)
Mark display as updated
Sourcepub fn set_array_size_interactive(&mut self, size: u32) -> Result<()>
pub fn set_array_size_interactive(&mut self, size: u32) -> Result<()>
Set array size interactively
Sourcepub fn attempt_set_array_size(&mut self, size: u32) -> bool
pub fn attempt_set_array_size(&mut self, size: u32) -> bool
Attempt to set array size with error handling
Sourcepub fn set_distribution_interactive(&mut self, distribution: DistributionType)
pub fn set_distribution_interactive(&mut self, distribution: DistributionType)
Set distribution interactively
Sourcepub fn set_fairness_mode_interactive(&mut self, mode: FairnessMode)
pub fn set_fairness_mode_interactive(&mut self, mode: FairnessMode)
Set fairness mode interactively
Sourcepub fn set_budget_parameter(&mut self, budget: u32) -> Result<()>
pub fn set_budget_parameter(&mut self, budget: u32) -> Result<()>
Set budget parameter
Sourcepub fn get_help_overlay_content(&self) -> String
pub fn get_help_overlay_content(&self) -> String
Get help overlay content
Trait Implementations§
Source§impl Clone for InteractiveMode
impl Clone for InteractiveMode
Source§fn clone(&self) -> InteractiveMode
fn clone(&self) -> InteractiveMode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for InteractiveMode
impl Debug for InteractiveMode
Auto Trait Implementations§
impl Freeze for InteractiveMode
impl RefUnwindSafe for InteractiveMode
impl Send for InteractiveMode
impl Sync for InteractiveMode
impl Unpin for InteractiveMode
impl UnwindSafe for InteractiveMode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more