<commit_before>// Copyright eeGeo Ltd (2012-2015), All Rights Reserved

#include "ScreenControlViewModelBase.h"

namespace ExampleApp
{
    namespace ScreenControl
    {
        namespace View
        {
            ScreenControlViewModelBase::ScreenControlViewModelBase(bool isInitiallyOnScreen)
                : m_onScreenState(1.f)
                , m_addedToScreen(isInitiallyOnScreen)
            {

            }

            ScreenControlViewModelBase::~ScreenControlViewModelBase()
            {

            }

            void ScreenControlViewModelBase::AddToScreen()
            {
                m_addedToScreen = true;
                m_onScreenStateChangedCallbacks.ExecuteCallbacks(*this, m_onScreenState);
            }

            void ScreenControlViewModelBase::RemoveFromScreen()
            {
                m_addedToScreen = false;
                m_onScreenStateChangedCallbacks.ExecuteCallbacks(*this, m_onScreenState);
            }

            void ScreenControlViewModelBase::UpdateOnScreenState(float onScreenState)
            {
                if(m_addedToScreen)
                {
                    Eegeo_ASSERT(onScreenState >= 0.f && onScreenState <= 1.f, "Invalid value %f for screen state, valid range for UI on-screen-state is 0.0 to 1.0 inclusive.\n", onScreenState);
                    m_onScreenState = onScreenState;
                    m_onScreenStateChangedCallbacks.ExecuteCallbacks(*this, m_onScreenState);
                }
            }<commit_msg>m_onScreenState variable of the base ScreenControlViewModel is now forced to a sensible value when calling AddToScreen/RemoveFromScreen. Buddy: Mark<commit_after>// Copyright eeGeo Ltd (2012-2015), All Rights Reserved

#include "ScreenControlViewModelBase.h"

namespace ExampleApp
{
    namespace ScreenControl
    {
        namespace View
        {
            ScreenControlViewModelBase::ScreenControlViewModelBase(bool isInitiallyOnScreen)
                : m_onScreenState(1.f)
                , m_addedToScreen(isInitiallyOnScreen)
            {

            }

            ScreenControlViewModelBase::~ScreenControlViewModelBase()
            {

            }

            void ScreenControlViewModelBase::AddToScreen()
            {
                m_addedToScreen = true;
                m_onScreenState = 1.0f;
                m_onScreenStateChangedCallbacks.ExecuteCallbacks(*this, m_onScreenState);
            }

            void ScreenControlViewModelBase::RemoveFromScreen()
            {
                m_addedToScreen = false;
                m_onScreenState = 0.0f;
                m_onScreenStateChangedCallbacks.ExecuteCallbacks(*this, m_onScreenState);
            }

            void ScreenControlViewModelBase::UpdateOnScreenState(float onScreenState)
            {
                if(m_addedToScreen)
                {
                    Eegeo_ASSERT(onScreenState >= 0.f && onScreenState <= 1.f, "Invalid value %f for screen state, valid range for UI on-screen-state is 0.0 to 1.0 inclusive.\n", onScreenState);
                    m_onScreenState = onScreenState;
                    m_onScreenStateChangedCallbacks.ExecuteCallbacks(*this, m_onScreenState);
                }
            }
{'fraction_non_alphanumeric': 0.06807584706248057, 'fraction_numerical': 0.010568852968604289, 'mean_word_length': 1.9468864468864469, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2647680', 'n_tokens_mistral': 862, 'n_tokens_neox': 785, 'n_words': 145}