updated to new accessors for scenes

This commit is contained in:
Nickiel12 2021-12-16 15:53:18 -08:00
parent 0618f7262a
commit 8fbc5be7d5
3 changed files with 28 additions and 28 deletions

View file

@ -13,9 +13,9 @@ pub struct StreamState {
pub timer_length: f32,
pub timer_text: String,
current_scene: enums::Scenes,
camera_sub_scene: enums::Scenes,
screen_sub_scene: enums::Scenes,
pub current_scene: enums::Scenes,
pub camera_sub_scene: enums::Scenes,
pub screen_sub_scene: enums::Scenes,
}
impl Default for StreamState {

View file

@ -53,7 +53,7 @@ fn message_handler_can_handle_multiple_messages() {
assert_eq!(handler.computer_sound_is_on, false);
assert_eq!(handler.scene_is_augmented, true);
assert_eq!(handler.scene_is_augmented, true);
assert_eq!(handler.get_current_scene(), Scenes::Augmented);
assert_eq!(handler.current_scene, Scenes::Augmented);
assert_eq!(handler.timer_can_run, false);
})
}

View file

@ -38,54 +38,54 @@ fn create_stream_states_class() {
assert_eq!(stream_state.timer_length, 15.0);
assert_eq!(stream_state.timer_can_run, true);
assert_eq!(stream_state.get_current_scene(), s_s::enums::Scenes::CameraDefault);
assert_eq!(stream_state.get_current_camera_sub_scene(), s_s::enums::Scenes::CameraDefault);
assert_eq!(stream_state.get_current_screen_sub_scene(), s_s::enums::Scenes::ScreenDefault);
assert_eq!(stream_state.current_scene, s_s::enums::Scenes::CameraDefault);
assert_eq!(stream_state.camera_sub_scene, s_s::enums::Scenes::CameraDefault);
assert_eq!(stream_state.screen_sub_scene, s_s::enums::Scenes::ScreenDefault);
}
#[test]
fn scene_correctness(){
let mut stream_state = s_s::stream_states_class::StreamState::new();
assert_eq!(stream_state.get_current_scene(), s_s::enums::Scenes::CameraDefault);
assert_eq!(stream_state.get_current_camera_sub_scene(), s_s::enums::Scenes::CameraDefault);
assert_eq!(stream_state.get_current_screen_sub_scene(), s_s::enums::Scenes::ScreenDefault);
assert_eq!(stream_state.current_scene, s_s::enums::Scenes::CameraDefault);
assert_eq!(stream_state.camera_sub_scene, s_s::enums::Scenes::CameraDefault);
assert_eq!(stream_state.screen_sub_scene, s_s::enums::Scenes::ScreenDefault);
stream_state.update(StateUpdate::Scene(s_s::enums::Scenes::CameraWithUpperRight));
assert_eq!(stream_state.get_current_scene(), s_s::enums::Scenes::CameraWithUpperRight);
assert_eq!(stream_state.get_current_camera_sub_scene(), s_s::enums::Scenes::CameraWithUpperRight);
assert_eq!(stream_state.get_current_screen_sub_scene(), s_s::enums::Scenes::ScreenDefault);
assert_eq!(stream_state.current_scene, s_s::enums::Scenes::CameraWithUpperRight);
assert_eq!(stream_state.camera_sub_scene, s_s::enums::Scenes::CameraWithUpperRight);
assert_eq!(stream_state.screen_sub_scene, s_s::enums::Scenes::ScreenDefault);
stream_state.update(StateUpdate::Scene(s_s::enums::Scenes::CameraWithLargeUpperRight));
assert_eq!(stream_state.get_current_scene(), s_s::enums::Scenes::CameraWithLargeUpperRight);
assert_eq!(stream_state.get_current_camera_sub_scene(), s_s::enums::Scenes::CameraWithLargeUpperRight);
assert_eq!(stream_state.get_current_screen_sub_scene(), s_s::enums::Scenes::ScreenDefault);
assert_eq!(stream_state.current_scene, s_s::enums::Scenes::CameraWithLargeUpperRight);
assert_eq!(stream_state.camera_sub_scene, s_s::enums::Scenes::CameraWithLargeUpperRight);
assert_eq!(stream_state.screen_sub_scene, s_s::enums::Scenes::ScreenDefault);
stream_state.update(StateUpdate::Scene(s_s::enums::Scenes::CameraWithLowerRight));
assert_eq!(stream_state.get_current_scene(), s_s::enums::Scenes::CameraWithLowerRight);
assert_eq!(stream_state.get_current_camera_sub_scene(), s_s::enums::Scenes::CameraWithLowerRight);
assert_eq!(stream_state.get_current_screen_sub_scene(), s_s::enums::Scenes::ScreenDefault);
assert_eq!(stream_state.current_scene, s_s::enums::Scenes::CameraWithLowerRight);
assert_eq!(stream_state.camera_sub_scene, s_s::enums::Scenes::CameraWithLowerRight);
assert_eq!(stream_state.screen_sub_scene, s_s::enums::Scenes::ScreenDefault);
stream_state.update(StateUpdate::Scene(s_s::enums::Scenes::ScreenDefault));
assert_eq!(stream_state.get_current_scene(), s_s::enums::Scenes::ScreenDefault);
assert_eq!(stream_state.get_current_screen_sub_scene(), s_s::enums::Scenes::ScreenDefault);
assert_eq!(stream_state.get_current_camera_sub_scene(), s_s::enums::Scenes::CameraWithLowerRight);
assert_eq!(stream_state.current_scene, s_s::enums::Scenes::ScreenDefault);
assert_eq!(stream_state.screen_sub_scene, s_s::enums::Scenes::ScreenDefault);
assert_eq!(stream_state.camera_sub_scene, s_s::enums::Scenes::CameraWithLowerRight);
stream_state.update(StateUpdate::Scene(s_s::enums::Scenes::ScreenWithLowerRight));
assert_eq!(stream_state.get_current_scene(), s_s::enums::Scenes::ScreenWithLowerRight);
assert_eq!(stream_state.get_current_screen_sub_scene(), s_s::enums::Scenes::ScreenWithLowerRight);
assert_eq!(stream_state.get_current_camera_sub_scene(), s_s::enums::Scenes::CameraWithLowerRight);
assert_eq!(stream_state.current_scene, s_s::enums::Scenes::ScreenWithLowerRight);
assert_eq!(stream_state.screen_sub_scene, s_s::enums::Scenes::ScreenWithLowerRight);
assert_eq!(stream_state.camera_sub_scene, s_s::enums::Scenes::CameraWithLowerRight);
stream_state.update(StateUpdate::Scene(s_s::enums::Scenes::ScreenWithUpperRight));
assert_eq!(stream_state.get_current_scene(), s_s::enums::Scenes::ScreenWithUpperRight);
assert_eq!(stream_state.get_current_screen_sub_scene(), s_s::enums::Scenes::ScreenWithUpperRight);
assert_eq!(stream_state.get_current_camera_sub_scene(), s_s::enums::Scenes::CameraWithLowerRight);
assert_eq!(stream_state.current_scene, s_s::enums::Scenes::ScreenWithUpperRight);
assert_eq!(stream_state.screen_sub_scene, s_s::enums::Scenes::ScreenWithUpperRight);
assert_eq!(stream_state.camera_sub_scene, s_s::enums::Scenes::CameraWithLowerRight);
}