Exemplo n.º 1
0
    void InitSwaps()
    {
        Angry.setPosition(new Position(Level.Excluded, Circle.Green));
        Blessing.setPosition(new Position(Level.Excluded, Circle.Purple));
        Child.setPosition(new Position(Level.Excluded, Circle.Red));
        Curse.setPosition(new Position(Level.Excluded, Circle.Cyan));
        Heaven.setPosition(new Position(Level.Tertiary, Circle.GreenPurpleRed));
        Happiness.setPosition(new Position(Level.Tertiary, Circle.GreenRedCyan));
        Dragon.setPosition(new Position(Level.Tertiary, Circle.RedCyanPurple));
        Dream.setPosition(new Position(Level.Secondary, Circle.CyanRed));
        Energy.setPosition(new Position(Level.Secondary, Circle.GreenRed));
        Female.setPosition(new Position(Level.Secondary, Circle.CyanPurple));
        Force.setPosition(new Position(Level.Quaternary, Circle.GreenRedCyanPurple));
        Forest.setPosition(new Position(Level.Excluded, Circle.Purple));
        Friend.setPosition(new Position(Level.Secondary, Circle.GreenPurple));
        Hate.setPosition(new Position(Level.Secondary, Circle.GreenPurple));
        Hope.setPosition(new Position(Level.Excluded, Circle.Green));
        Kindness.setPosition(new Position(Level.Tertiary, Circle.CyanPurpleGreen));
        Longevity.setPosition(new Position(Level.Secondary, Circle.CyanPurple));
        Love.setPosition(new Position(Level.Secondary, Circle.CyanPurple));
        Loyal.setPosition(new Position(Level.Secondary, Circle.GreenRed));
        Spirit.setPosition(new Position(Level.Secondary, Circle.CyanRed));
        Male.setPosition(new Position(Level.Quaternary, Circle.GreenRedCyanPurple));
        Mountain.setPosition(new Position(Level.Secondary, Circle.GreenRed));
        Night.setPosition(new Position(Level.Excluded, Circle.Red));
        Pure.setPosition(new Position(Level.Secondary, Circle.GreenPurple));
        Heart.setPosition(new Position(Level.Secondary, Circle.CyanRed));
        River.setPosition(new Position(Level.Excluded, Circle.Cyan));
        Emotion.setPosition(new Position(Level.Excluded, Circle.Cyan));
        Soul.setPosition(new Position(Level.Excluded, Circle.Purple));
        Urgency.setPosition(new Position(Level.Excluded, Circle.Red));
        Wind.setPosition(new Position(Level.Excluded, Circle.Green));

        Debug.LogFormat("[Dragon Energy #{0}] Before swapping, the displayed words are:", _moduleId);
        for (int i = 0; i < displayed.Length; i++)
        {
            Debug.LogFormat("[Dragon Energy #{0}] {1} = {2}", _moduleId, displayed[i].getWord(), displayed[i].getPosition().getCircle().ToReadable());
        }

        char[] letters    = info.GetSerialNumberLetters().ToArray();
        int    vowelCount = 0;

        foreach (char letter in letters)
        {
            if (letter == 'A' || letter == 'E' || letter == 'I' || letter == 'O' || letter == 'U')
            {
                vowelCount++;
            }
        }

        if (info.GetBatteryCount() > 10 && (info.GetSerialNumberNumbers().ToArray()[info.GetSerialNumberNumbers().ToArray().Length - 1] == 5 || info.GetSerialNumberNumbers().ToArray()[info.GetSerialNumberNumbers().ToArray().Length - 1] == 7))
        {
            Swaps(1);
        }
        else if (info.GetPortPlateCount() > info.GetBatteryHolderCount() && (modules.Contains("Morse War") || modules.Contains("Double Color")))
        {
            Swaps(2);
        }
        else if ((info.IsIndicatorOn(Indicator.SIG) && info.IsIndicatorOn(Indicator.FRK)) || (info.GetOffIndicators().Count() == 3))
        {
            Swaps(3);
        }
        else if (info.GetModuleNames().Count() > 8)
        {
            Swaps(4);
        }
        else if (vowelCount >= 2)
        {
            Swaps(5);
        }
        else if (info.GetSolvedModuleNames().Count() == 0)
        {
            Swaps(6);
            dependsOnSolvedModules = true;
        }
        else
        {
            Swaps(7);
        }

        Debug.LogFormat("[Dragon Energy #{0}] After swapping, the displayed words are:", _moduleId);
        for (int i = 0; i < displayed.Length; i++)
        {
            Debug.LogFormat("[Dragon Energy #{0}] {1} = {2}", _moduleId, displayed[i].getWord(), displayed[i].getPosition().getCircle().ToReadable());
        }
    }