updated to new accessors for scenes
This commit is contained in:
parent
0618f7262a
commit
8fbc5be7d5
3 changed files with 28 additions and 28 deletions
|
@ -13,9 +13,9 @@ pub struct StreamState {
|
||||||
pub timer_length: f32,
|
pub timer_length: f32,
|
||||||
pub timer_text: String,
|
pub timer_text: String,
|
||||||
|
|
||||||
current_scene: enums::Scenes,
|
pub current_scene: enums::Scenes,
|
||||||
camera_sub_scene: enums::Scenes,
|
pub camera_sub_scene: enums::Scenes,
|
||||||
screen_sub_scene: enums::Scenes,
|
pub screen_sub_scene: enums::Scenes,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for StreamState {
|
impl Default for StreamState {
|
||||||
|
|
|
@ -53,7 +53,7 @@ fn message_handler_can_handle_multiple_messages() {
|
||||||
assert_eq!(handler.computer_sound_is_on, false);
|
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.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);
|
assert_eq!(handler.timer_can_run, false);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,54 +38,54 @@ fn create_stream_states_class() {
|
||||||
assert_eq!(stream_state.timer_length, 15.0);
|
assert_eq!(stream_state.timer_length, 15.0);
|
||||||
assert_eq!(stream_state.timer_can_run, true);
|
assert_eq!(stream_state.timer_can_run, true);
|
||||||
|
|
||||||
assert_eq!(stream_state.get_current_scene(), s_s::enums::Scenes::CameraDefault);
|
assert_eq!(stream_state.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.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.screen_sub_scene, s_s::enums::Scenes::ScreenDefault);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn scene_correctness(){
|
fn scene_correctness(){
|
||||||
let mut stream_state = s_s::stream_states_class::StreamState::new();
|
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.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.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.screen_sub_scene, s_s::enums::Scenes::ScreenDefault);
|
||||||
|
|
||||||
stream_state.update(StateUpdate::Scene(s_s::enums::Scenes::CameraWithUpperRight));
|
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.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.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.screen_sub_scene, s_s::enums::Scenes::ScreenDefault);
|
||||||
|
|
||||||
stream_state.update(StateUpdate::Scene(s_s::enums::Scenes::CameraWithLargeUpperRight));
|
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.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.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.screen_sub_scene, s_s::enums::Scenes::ScreenDefault);
|
||||||
|
|
||||||
stream_state.update(StateUpdate::Scene(s_s::enums::Scenes::CameraWithLowerRight));
|
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.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.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.screen_sub_scene, s_s::enums::Scenes::ScreenDefault);
|
||||||
|
|
||||||
stream_state.update(StateUpdate::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.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.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.camera_sub_scene, s_s::enums::Scenes::CameraWithLowerRight);
|
||||||
|
|
||||||
stream_state.update(StateUpdate::Scene(s_s::enums::Scenes::ScreenWithLowerRight));
|
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.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.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.camera_sub_scene, s_s::enums::Scenes::CameraWithLowerRight);
|
||||||
|
|
||||||
stream_state.update(StateUpdate::Scene(s_s::enums::Scenes::ScreenWithUpperRight));
|
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.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.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.camera_sub_scene, s_s::enums::Scenes::CameraWithLowerRight);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue