コード例 #1
0
    private void SerializeLevelFromXML(string path, XmlReader reader)
    {
        var        serializer = new XmlSerializer(typeof(XMLLetters));
        XMLLetters xmlLevel   = serializer.Deserialize(reader) as XMLLetters;

        Dictionary <char, RTLLetter> ltrs = new Dictionary <char, RTLLetter>();

        foreach (RTLLetter ltr in xmlLevel.letters)
        {
            ltrs.Add(ltr.r[0], ltr);
        }
        RTL.letters        = ltrs;
        RTL.letterReaplace = xmlLevel.letterReaplace;

        RTL.exceptions = new char[xmlLevel.exceptions.Length];
        for (int i = 0; i < xmlLevel.exceptions.Length; i++)
        {
            RTL.exceptions[i] = xmlLevel.exceptions[i][0];
        }

        RTL.superExceptions = new char[xmlLevel.superExceptions.Length];
        for (int i = 0; i < xmlLevel.superExceptions.Length; i++)
        {
            RTL.superExceptions[i] = xmlLevel.superExceptions[i][0];
        }
    }
コード例 #2
0
    public static IEnumerator LoadLettersXML()
    {
        XMLLetters xmlLetters = new XMLLetters();

        yield return(xmlLetters.LoadFromResources("Gameplay/letters"));

        yield return(true);
    }
コード例 #3
0
ファイル: XMLTool.cs プロジェクト: Megapop/feed-the-monster
    public static IEnumerator LoadLettersXML()
    {
        XMLLetters xmlLetters = new XMLLetters();

        yield return(xmlLetters.LoadFromResources("Gameplay/letters"));

        XMLController.Instance.isLetterLoaded = true;
        yield return(true);
    }
コード例 #4
0
    private void SerializeLevelFromXML(string path, XmlReader reader)
    {
        Dictionary <char, string> ltrs = new Dictionary <char, string>();

        var        serializer = new XmlSerializer(typeof(XMLLetters));
        XMLLetters xmlLevel   = serializer.Deserialize(reader) as XMLLetters;

        foreach (string ltr in xmlLevel.letters)
        {
            ltrs.Add(ltr[0], ltr);
        }
    }