本文整理汇总了C#中Chapter.getBooks方法的典型用法代码示例。如果您正苦于以下问题:C# Chapter.getBooks方法的具体用法?C# Chapter.getBooks怎么用?C# Chapter.getBooks使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chapter
的用法示例。
在下文中一共展示了Chapter.getBooks方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: loadIdentifiers
/**
* Reloads the identifiers with the given chapter data.
*
* @param chapter
* Chapter data which will provide the identifiers
*/
public void loadIdentifiers(Chapter chapter)
{
// Clear the lists
globalIdentifiers.Clear();
generalSceneIdentifiers.Clear();
sceneIdentifiers.Clear();
cutsceneIdentifiers.Clear();
bookIdentifiers.Clear();
itemIdentifiers.Clear();
atrezzoIdentifiers.Clear();
npcIdentifiers.Clear();
conversationIdentifiers.Clear();
globalStateIdentifiers.Clear();
macroIdentifiers.Clear();
activeAreaIdentifiers.Clear();
assessmentIdentifiers.Clear();
adaptationIdentifiers.Clear();
// Add scene IDs
foreach (Scene scene in chapter.getScenes())
{
addSceneId(scene.getId());
foreach (ActiveArea activeArea in scene.getActiveAreas())
{
if (activeArea.getId() != null && !activeArea.getId().Equals(""))
addActiveAreaId(activeArea.getId());
}
}
// Add cutscene IDs
foreach (Cutscene cutscene in chapter.getCutscenes())
addCutsceneId(cutscene.getId());
// Add book IDs
foreach (Book book in chapter.getBooks())
addBookId(book.getId());
// Add item IDs
foreach (Item item in chapter.getItems())
addItemId(item.getId());
// Add atrezzo items IDs
foreach (Atrezzo atrezzo in chapter.getAtrezzo())
addAtrezzoId(atrezzo.getId());
// Add NPC IDs
foreach (NPC npc in chapter.getCharacters())
addNPCId(npc.getId());
// Add conversation IDs
foreach (Conversation conversation in chapter.getConversations())
addConversationId(conversation.getId());
// Add global state IDs
foreach (GlobalState globalState in chapter.getGlobalStates())
addGlobalStateId(globalState.getId());
// Add macro IDs
foreach (Macro macro in chapter.getMacros())
addMacroId(macro.getId());
// Add assessment rules ids and asssessmnet profiles ids
foreach (AssessmentProfile profile in chapter.getAssessmentProfiles())
{
string name = profile.getName();
addAssessmentProfileId(name);
foreach (AssessmentRule rule in profile.getRules())
this.addAssessmentRuleId(rule.getId(), name);
}
// Add adaptation rules ids and asssessmnet profiles ids
foreach (AdaptationProfile profile in chapter.getAdaptationProfiles())
{
string name = profile.getName();
addAdaptationProfileId(name);
foreach (AdaptationRule rule in profile.getRules())
this.addAdaptationRuleId(rule.getId(), name);
}
}
示例2: startElement
//.........这里部分代码省略.........
}
// If reading the contents tag, switch to the chapters mode
else if (qName.Equals("contents"))
{
reading = READING_CHAPTER;
}
// If reading the contents of a chapter, create a new one to store the data
else if (qName.Equals("chapter"))
{
// Create the chapter
currentChapter = new Chapter();
// Search and store the path of the file
string chapterPath = null;
foreach (KeyValuePair<string, string> entry in attrs)
if (entry.Key.Equals("path"))
chapterPath = entry.Value.ToString();
if (chapterPath != null)
{
currentChapter.setChapterPath(chapterPath);
}
else
currentChapter.setChapterPath("");
// Open the file and load the data
try
{
// Set the chapter handler
// ChapterHandler chapterParser = new ChapterHandler(isCreator, currentChapter);
ChapterHandler_ chapterParser = new ChapterHandler_(currentChapter);
Debug.Log(currentChapter.getBooks().Count);
//// Create a new factory
//SAXParserFactory factory = SAXParserFactory.newInstance();
////factory.setValidating( validate );
//factory.setValidating(false);
//SAXParser saxParser = factory.newSAXParser();
//// Set the input stream with the file
//InputStream chapterIS = isCreator.buildInputStream(chapterPath);
//// Parse the data and close the data
//saxParser.parse(chapterIS, chapterParser);
//chapterIS.close();
string chapterIS = isCreator.buildInputStream(chapterPath);
chapterParser.Parse(chapterIS);
}
catch (Exception e) { Debug.LogError(e); }
//catch (ParserConfigurationException e)
//{
// incidences.add(Incidence.createChapterIncidence(Language.GetText("Error.LoadData.SAX"), chapterPath, e));
//}
//catch (SAXException e)
//{
// incidences.add(Incidence.createChapterIncidence(Language.GetText("Error.LoadData.SAX"), chapterPath, e));
//}
//catch (IOException e)
//{
// incidences.add(Incidence.createChapterIncidence(Language.GetText("Error.LoadData.IO"), chapterPath, e));
//}
}
// If reading the adaptation configuration, store it