本文整理汇总了C#中Action.setDocumentation方法的典型用法代码示例。如果您正苦于以下问题:C# Action.setDocumentation方法的具体用法?C# Action.setDocumentation怎么用?C# Action.setDocumentation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Action
的用法示例。
在下文中一共展示了Action.setDocumentation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: endElement
/*
* (non-Javadoc)
*
* @see es.eucm.eadventure.engine.cargador.subparsers.SubParser#endElement(java.lang.string, java.lang.string,
* java.lang.string)
*/
public override void endElement(string namespaceURI, string sName, string qName)
{
// If no element is being subparsed
if (subParsing == SUBPARSING_NONE)
{
// If it is a resources tag, add it to the object
if (qName.Equals("resources"))
{
if (reading == READING_RESOURCES)
{
currentCustomAction.addResources(currentResources);
reading = READING_NONE;
}
}
// If it is a documentation tag, hold the documentation in the current element
else if (qName.Equals("documentation"))
{
currentDocumentation = currentstring.ToString().Trim();
}
// If it is a examine tag, store the new action in the object
else if (qName.Equals("examine"))
{
Action examineAction = new Action(Action.EXAMINE, currentConditions, currentEffects, currentNotEffects);
examineAction.setDocumentation(currentDocumentation);
examineAction.setKeepDistance(currentKeepDistance);
examineAction.setNeedsGoTo(currentNeedsGoTo);
examineAction.setActivatedNotEffects(activateNotEffects);
examineAction.setActivatedClickEffects(activateClickEffects);
element.addAction(examineAction);
reading = READING_NONE;
}
// If it is a grab tag, store the new action in the object
else if (qName.Equals("grab"))
{
Action grabAction = new Action(Action.GRAB, currentConditions, currentEffects, currentNotEffects);
grabAction.setDocumentation(currentDocumentation);
grabAction.setKeepDistance(currentKeepDistance);
grabAction.setNeedsGoTo(currentNeedsGoTo);
grabAction.setActivatedNotEffects(activateNotEffects);
grabAction.setActivatedClickEffects(activateClickEffects);
element.addAction(grabAction);
reading = READING_NONE;
}
// If it is an use tag, store the new action in the object
else if (qName.Equals("use"))
{
Action useAction = new Action(Action.USE, currentConditions, currentEffects, currentNotEffects);
useAction.setDocumentation(currentDocumentation);
useAction.setNeedsGoTo(currentNeedsGoTo);
useAction.setKeepDistance(currentKeepDistance);
useAction.setActivatedNotEffects(activateNotEffects);
useAction.setActivatedClickEffects(activateClickEffects);
element.addAction(useAction);
reading = READING_NONE;
}
// If it is an use tag, store the new action in the object
else if (qName.Equals("talk-to"))
{
Action talkToAction = new Action(Action.TALK_TO, currentConditions, currentEffects, currentNotEffects);
talkToAction.setDocumentation(currentDocumentation);
talkToAction.setNeedsGoTo(currentNeedsGoTo);
talkToAction.setKeepDistance(currentKeepDistance);
talkToAction.setActivatedNotEffects(activateNotEffects);
talkToAction.setActivatedClickEffects(activateClickEffects);
element.addAction(talkToAction);
reading = READING_NONE;
}
// If it is an use-with tag, store the new action in the object
else if (qName.Equals("use-with"))
{
Action useWithAction = new Action(Action.USE_WITH, currentIdTarget, currentConditions, currentEffects, currentNotEffects, currentClickEffects);
useWithAction.setDocumentation(currentDocumentation);
useWithAction.setKeepDistance(currentKeepDistance);
useWithAction.setNeedsGoTo(currentNeedsGoTo);
useWithAction.setActivatedNotEffects(activateNotEffects);
useWithAction.setActivatedClickEffects(activateClickEffects);
element.addAction(useWithAction);
reading = READING_NONE;
}
// If it is an use-with tag, store the new action in the object
else if (qName.Equals("drag-to"))
{
Action useWithAction = new Action(Action.DRAG_TO, currentIdTarget, currentConditions, currentEffects, currentNotEffects, currentClickEffects);
useWithAction.setDocumentation(currentDocumentation);
useWithAction.setKeepDistance(currentKeepDistance);
useWithAction.setNeedsGoTo(currentNeedsGoTo);
//.........这里部分代码省略.........
示例2: ParseElement
public override void ParseElement(XmlElement element)
{
XmlNodeList
resourcess = element.SelectNodes("resources"),
descriptionss = element.SelectNodes("description"),
assets,
conditions,
frontcolors,
bordercolors,
textcolors = element.SelectNodes("textcolor"),
conversationsref = element.SelectNodes("conversation-ref"),
voices = element.SelectNodes("voice"),
actionss = element.SelectNodes("actions");
string tmpArgVal;
string characterId = element.GetAttribute("id");
npc = new NPC(characterId);
descriptions = new List<Description>();
npc.setDescriptions(descriptions);
if (element.SelectSingleNode("documentation") != null)
npc.setDocumentation(element.SelectSingleNode("documentation").InnerText);
foreach (XmlElement el in resourcess)
{
currentResources = new ResourcesUni();
tmpArgVal = el.GetAttribute("name");
if (!string.IsNullOrEmpty(tmpArgVal))
{
currentResources.setName(el.GetAttribute(tmpArgVal));
}
assets = el.SelectNodes("asset");
foreach (XmlElement ell in assets)
{
string type = "";
string path = "";
tmpArgVal = ell.GetAttribute("type");
if (!string.IsNullOrEmpty(tmpArgVal))
{
type = tmpArgVal;
}
tmpArgVal = ell.GetAttribute("uri");
if (!string.IsNullOrEmpty(tmpArgVal))
{
path = tmpArgVal;
}
currentResources.addAsset(type, path);
}
conditions = el.SelectNodes("condition");
foreach (XmlElement ell in conditions)
{
currentConditions = new Conditions();
new ConditionSubParser_(currentConditions, chapter).ParseElement(ell);
currentResources.setConditions(currentConditions);
}
npc.addResources(currentResources);
}
foreach (XmlElement el in textcolors)
{
tmpArgVal = el.GetAttribute("showsSpeechBubble");
if (!string.IsNullOrEmpty(tmpArgVal))
{
npc.setShowsSpeechBubbles(tmpArgVal.Equals("yes"));
}
tmpArgVal = el.GetAttribute("bubbleBkgColor");
if (!string.IsNullOrEmpty(tmpArgVal))
{
npc.setBubbleBkgColor(tmpArgVal);
}
tmpArgVal = el.GetAttribute("bubbleBorderColor");
if (!string.IsNullOrEmpty(tmpArgVal))
{
npc.setBubbleBorderColor(tmpArgVal);
}
frontcolors = el.SelectNodes("frontcolor");
foreach (XmlElement ell in frontcolors)
{
string color = "";
tmpArgVal = ell.GetAttribute("color");
if (!string.IsNullOrEmpty(tmpArgVal))
{
color = tmpArgVal;
}
npc.setTextFrontColor(color);
}
bordercolors = el.SelectNodes("bordercolor");
//.........这里部分代码省略.........
示例3: endElement
/*
* (non-Javadoc)
*
* @see es.eucm.eadventure.engine.loader.subparsers.SubParser#endElement(java.lang.string, java.lang.string,
* java.lang.string)
*/
public override void endElement(string namespaceURI, string sName, string qName)
{
// If no element is being subparsed
if (subParsing == SUBPARSING_NONE)
{
// If it is a character tag, store the character in the game data
if (qName.Equals("character"))
{
chapter.addCharacter(npc);
}
// If it is a documentation tag, hold the documentation in the character
else if (qName.Equals("documentation"))
{
if (reading == READING_NONE)
npc.setDocumentation(currentstring.ToString().Trim());
else if (reading == READING_CONVERSATION_REFERENCE)
conversationReference.setDocumentation(currentstring.ToString().Trim());
}
// If it is a resources tag, add the resources in the character
else if (qName.Equals("resources"))
{
npc.addResources(currentResources);
reading = READING_NONE;
}
// If it is a conversation reference tag, add the reference to the character
else if (qName.Equals("conversation-ref"))
{
//npc.addConversationReference( conversationReference );
Action action = new Action(Action.TALK_TO);
action.setConditions(conversationReference.getConditions());
action.setDocumentation(conversationReference.getDocumentation());
TriggerConversationEffect effect = new TriggerConversationEffect(conversationReference.getTargetId());
action.getEffects().add(effect);
npc.addAction(action);
reading = READING_NONE;
}
// Reset the current string
currentstring = "";
}
// If a condition is being subparsed
else if (subParsing == SUBPARSING_CONDITION)
{
// Spread the end element call
subParser.endElement(namespaceURI, sName, qName);
// If the condition is being closed
if (qName.Equals("condition"))
{
// Add the condition to the resources
if (reading == READING_RESOURCES)
currentResources.setConditions(currentConditions);
// Add the condition to the conversation reference
if (reading == READING_CONVERSATION_REFERENCE)
conversationReference.setConditions(currentConditions);
// Stop subparsing
subParsing = SUBPARSING_NONE;
}
}
else if (subParsing == SUBPARSING_ACTIONS)
{
subParser.endElement(namespaceURI, sName, qName);
if (qName.Equals("actions"))
{
subParsing = SUBPARSING_NONE;
}
}
// If it is a description tag, create the new description (with its id)
else if (subParsing == SUBPARSING_DESCRIPTION)
{
// Spread the call
subParser.endElement(namespaceURI, sName, qName);
if (qName.Equals("description"))
{
this.descriptions.Add(description);
subParsing = SUBPARSING_NONE;
}
}
}