当前位置: 首页>>代码示例>>C#>>正文


C# Chapter.setAssessmentName方法代码示例

本文整理汇总了C#中Chapter.setAssessmentName方法的典型用法代码示例。如果您正苦于以下问题:C# Chapter.setAssessmentName方法的具体用法?C# Chapter.setAssessmentName怎么用?C# Chapter.setAssessmentName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Chapter的用法示例。


在下文中一共展示了Chapter.setAssessmentName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Parse


//.........这里部分代码省略.........
                        uri = tmpString;
                    }

                    adventureData.addArrow(type, uri);
                }
            }

            XmlElement mode = (XmlElement) configuration.SelectSingleNode ("mode");
            if (mode != null)
            {
                tmpString = mode.GetAttribute ("playerTransparent");
                if (!string.IsNullOrEmpty(tmpString)){
                    adventureData.setPlayerMode (tmpString.Equals ("yes") ? DescriptorData.MODE_PLAYER_1STPERSON : DescriptorData.MODE_PLAYER_3RDPERSON);
                }
            }

            XmlElement graphics = (XmlElement) configuration.SelectSingleNode ("graphics");
            if (graphics != null)
            {
                tmpString = graphics.GetAttribute ("playerTransparent");
                if (!string.IsNullOrEmpty(tmpString)){
                    switch (tmpString) {
                    case "windowed":    adventureData.setGraphicConfig(DescriptorData.GRAPHICS_WINDOWED); break;
                    case "fullscreen":  adventureData.setGraphicConfig(DescriptorData.GRAPHICS_FULLSCREEN); break;
                    case "blackbkg":    adventureData.setGraphicConfig(DescriptorData.GRAPHICS_BLACKBKG); break;
                    }
                }
            }
        }

        if (contents != null) {
            Chapter currentChapter;

            XmlNodeList chapters = contents.SelectNodes ("chapter");
            foreach (XmlElement chapter in chapters) {
                currentChapter = new Chapter ();

                string chapterPath = "";
                tmpString = chapter.GetAttribute ("path");
                if (!string.IsNullOrEmpty(tmpString)){
                    chapterPath = tmpString;
                }
                currentChapter.setChapterPath(directory + chapterPath);

                ChapterHandler_ chapterParser = new ChapterHandler_(currentChapter);
                chapterParser.Parse (directory + chapterPath);

                title = (XmlElement) chapter.SelectSingleNode ("title");
                if (title != null) {
                    tmpString = title.InnerText;

                    if (!string.IsNullOrEmpty(tmpString))
                    {
                        currentChapter.setTitle (tmpString);
                    }
                }

                description = (XmlElement) chapter.SelectSingleNode ("description");
                if (description != null) {
                    tmpString = title.InnerText;

                    if (!string.IsNullOrEmpty(tmpString))
                    {
                        currentChapter.setDescription (tmpString);
                    }
                }

                XmlElement adaptation = (XmlElement) chapter.SelectSingleNode ("adaptation-configuration");
                if (adaptation != null) {
                    tmpString = adaptation.GetAttribute ("path");
                    if (!string.IsNullOrEmpty (tmpString)) {
                        string adaptationName = tmpString;
                        // delete the path's characteristics
                        adaptationName = adaptationName.Substring (adaptationName.IndexOf ("/") + 1);
                        adaptationName = adaptationName.Substring (0, adaptationName.IndexOf ("."));
                        currentChapter.setAdaptationName (adaptationName);
                    }
                }

                XmlElement assestment = (XmlElement) chapter.SelectSingleNode ("assessment-configuration");
                if (adaptation != null) {
                    tmpString = adaptation.GetAttribute ("path");
                    if (!string.IsNullOrEmpty (tmpString)) {
                        string assessmentName = tmpString;
                        // delete the path's characteristics
                        assessmentName = assessmentName.Substring(assessmentName.IndexOf("/") + 1);
                        assessmentName = assessmentName.Substring(0, assessmentName.IndexOf("."));
                        currentChapter.setAssessmentName(assessmentName);
                    }
                }

                adventureData.addChapter (currentChapter);
            }
        }

        /*if (qName.EndsWith("automatic-commentaries"))
        {
            adventureData.setCommentaries(true);
        }*/
    }
开发者ID:Synpheros,项目名称:eAdventure4Unity,代码行数:101,代码来源:AdventureHandler_.cs


注:本文中的Chapter.setAssessmentName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。