private void NotifyMorseInProgress(MorseKey newMorseKey)
    {
        MorseValueWithOrigine morseLinked = GetCurrentMorseValueWithOrigine();

        m_onMorseKeyDetected.Invoke(newMorseKey, morseLinked);
        m_onMorseChanged.Invoke(morseLinked);
    }
    public MorseValueWithOrigine GetCurrentMorseValueWithOrigine()
    {
        MorseValue            valueDetected = new MorseValue(m_detectedKeys.ToArray());
        string                morseName     = m_morseSource.GetSourceName();
        MorseValueWithOrigine morseLinked   = new MorseValueWithOrigine(morseName, valueDetected);

        return(morseLinked);
    }
    private void DisplayMorseFound(MorseValueWithOrigine morse)
    {
        string morseText = TryToGestMorseValue(morse);

        m_displayCurrentlyTyped.text      = morseText;
        m_displayCurrentlyTypedMorse.text = morse.GetMorseValue().ToString();

        m_lastMorseReceived = morse.GetMorseValue();
    }
    public void DisplayMorseDetected(MorseValueWithOrigine morse)
    {
        string morseText = TryToGestMorseValue(morse);

        DisplayMorseFound(morse);
        if (morseText != "?")
        {
            m_displayKeyFound.text += morseText;
        }
    }
 private void CheckForGoodAnswer(MorseValueWithOrigine value)
 {
     for (int i = 0; i < m_letterDisplayer.Length; i++)
     {
         if (value.GetMorseValue() == m_letterDisplayer[i].GetLinkedMorseValue())
         {
             m_letterDisplayer[i].Reset();
             m_scoreDisplay.text = (++m_playerScore).ToString();
         }
     }
 }
    public void AddMorseFound(MorseValueWithOrigine morse)
    {
        m_morsesDetected.Add(string.Format("{0}:{1}", morse.GetMorseValue(), morse.GetEmittorName()));
        if (m_morsesDetected.Count > m_maxDisplay)
        {
            m_morsesDetected.RemoveAt(0);
        }

        //Bad Code, Should not be call at morse found but I am sleepy.
        m_detectorCout = MorseDetectorUtilitary.GetDetectorsCount();
    }
 private string TryToGestMorseValue(MorseValueWithOrigine morse)
 {
     return(MorseUtility.GuessValueInClassicMorse(morse.GetMorseValue()));
 }
 private void DisplayMorseInChange(MorseKey key, MorseValueWithOrigine morse)
 {
     DisplayMorseFound(morse);
 }
    private void NotifyMorseDetected()
    {
        MorseValueWithOrigine morseLinked = GetCurrentMorseValueWithOrigine();

        m_onMorseDetected.Invoke(morseLinked);
    }
Пример #10
0
 private void ApplyMorseDetected(MorseValueWithOrigine morseFound)
 {
     m_onMorseDetected.Invoke(morseFound);
 }
 private static void FowardMorseDetected(MorseValueWithOrigine morseValue)
 {
     OnMorseDetected.Invoke(morseValue);
 }