From 8fbc5be7d53188d695f2b451f9840d3dfd930ae4 Mon Sep 17 00:00:00 2001 From: Nickiel12 <35903114+Nickiel12@users.noreply.github.com> Date: Thu, 16 Dec 2021 15:53:18 -0800 Subject: [PATCH] updated to new accessors for scenes --- .../stream_states/stream_states_class.rs | 6 +-- src/tests/message_handler_tests.rs | 2 +- src/tests/stream_states_tests.rs | 48 +++++++++---------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/modules/stream_states/stream_states_class.rs b/src/modules/stream_states/stream_states_class.rs index ee5df1c..10eba10 100644 --- a/src/modules/stream_states/stream_states_class.rs +++ b/src/modules/stream_states/stream_states_class.rs @@ -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 { diff --git a/src/tests/message_handler_tests.rs b/src/tests/message_handler_tests.rs index 63e70ac..d8cb788 100644 --- a/src/tests/message_handler_tests.rs +++ b/src/tests/message_handler_tests.rs @@ -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); }) } diff --git a/src/tests/stream_states_tests.rs b/src/tests/stream_states_tests.rs index de147f5..add8a95 100644 --- a/src/tests/stream_states_tests.rs +++ b/src/tests/stream_states_tests.rs @@ -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); }