本文整理汇总了C#中BlamLib.SaveCursor方法的典型用法代码示例。如果您正苦于以下问题:C# BlamLib.SaveCursor方法的具体用法?C# BlamLib.SaveCursor怎么用?C# BlamLib.SaveCursor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BlamLib
的用法示例。
在下文中一共展示了BlamLib.SaveCursor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessDefinition
protected override void ProcessDefinition(XmlNode node, BlamLib.CheApe.ProjectState state, BlamLib.IO.XmlStream s)
{
StringIdFieldsInitialize(state);
switch (node.Name)
{
#region Tag Structs
case "structs":
s.SaveCursor(node);
ProcessTagStructs(state, s);
s.RestoreCursor();
break;
#endregion
#region Tag Blocks
case "blocks":
s.SaveCursor(node);
ProcessTagBlocks(state, s);
s.RestoreCursor();
break;
#endregion
#region Tag Groups
case "groups":
s.SaveCursor(node);
ProcessTagGroups(state, s);
s.RestoreCursor();
break;
#endregion
}
}
示例2: ProcessFile
/// <summary>
/// Process a XML file containing CheApe definitions
/// </summary>
/// <param name="state"></param>
/// <param name="s"></param>
private void ProcessFile(ProjectState state, BlamLib.IO.XmlStream s)
{
int complexity = 1 +
PreprocessXmlNodeComplexity();
BlamVersion def_engine = BlamVersion.Unknown;
s.ReadAttribute("game", ref def_engine);
if (def_engine != state.Definition.Engine)
{
Debug.Assert.If(false, "CheApe definition '{0}' is for {1}. Expected a {2} definition.", s.FileName, def_engine, state.Definition.Engine);
}
else
{
foreach (XmlNode n in s.Cursor.ChildNodes)
{
switch (n.Name)
{
#region Enums
case "enums":
s.SaveCursor(n);
ProcessEnums(state, s);
s.RestoreCursor();
break;
#endregion
#region Flags
case "flags":
s.SaveCursor(n);
ProcessFlags(state, s);
s.RestoreCursor();
break;
#endregion
#region Tag References
case "references":
s.SaveCursor(n);
ProcessTagReferences(state, s);
s.RestoreCursor();
break;
#endregion
#region Tag Data
case "data":
s.SaveCursor(n);
ProcessTagDatas(state, s);
s.RestoreCursor();
break;
#endregion
#region Script Functions
case "scriptFunctions":
if (state.scriptingInterface == null) break;
s.SaveCursor(n);
ProcessScriptFunctions(state, s);
s.RestoreCursor();
break;
#endregion
#region Script Globals
case "scriptGlobals":
if (state.scriptingInterface == null) break;
s.SaveCursor(n);
ProcessScriptGlobals(state, s);
s.RestoreCursor();
break;
#endregion
#region Fix-ups
case "fixups":
s.SaveCursor(n);
ProcessFixups(state, s);
s.RestoreCursor();
break;
#endregion
default:
ProcessDefinition(n, state, s);
break;
}
}
}
}
示例3: ProcessDefinition
protected override void ProcessDefinition(XmlNode node, BlamLib.CheApe.ProjectState state, BlamLib.IO.XmlStream s)
{
StringIdFieldsInitialize(state);
string name_str;
switch (node.Name)
{
#region Tag Structs
case "structs":
s.SaveCursor(node);
foreach (XmlNode n in s.Cursor.ChildNodes)
{
if (n.Name != "Struct") continue;
s.SaveCursor(n);
TagStruct block = new TagStruct(state, s);
s.RestoreCursor();
name_str = block.ToString();
try { Structs.Add(name_str, block); }
catch (ArgumentException) { Debug.LogFile.WriteLine(CheApe.Import.kDuplicateErrorStr, "tag struct definition", name_str); }
}
s.RestoreCursor();
break;
#endregion
#region Tag Blocks
case "blocks":
s.SaveCursor(node);
foreach (XmlNode n in s.Cursor.ChildNodes)
{
if (n.Name != "TagBlock") continue;
s.SaveCursor(n);
TagBlock block = new TagBlock(state, s);
s.RestoreCursor();
name_str = block.ToString();
try { Blocks.Add(name_str, block); }
catch (ArgumentException) { Debug.LogFile.WriteLine(CheApe.Import.kDuplicateErrorStr, "tag block definition", name_str); }
}
s.RestoreCursor();
break;
#endregion
#region Tag Groups
case "groups":
s.SaveCursor(node);
foreach (XmlNode n in s.Cursor.ChildNodes)
{
if (n.Name != "TagGroup") continue;
s.SaveCursor(n);
TagGroup group = new TagGroup(state, s);
s.RestoreCursor();
name_str = group.ToString();
try { Groups.Add(name_str, group); }
catch (ArgumentException) { Debug.LogFile.WriteLine(CheApe.Import.kDuplicateErrorStr, "tag group definition", name_str); }
}
s.RestoreCursor();
break;
#endregion
}
}
示例4: ProcessFile
/// <summary>
/// Process a XML file containing CheApe definitions
/// </summary>
/// <param name="state"></param>
/// <param name="s"></param>
private void ProcessFile(ProjectState state, BlamLib.IO.XmlStream s)
{
int complexity = 1 +
PreprocessXmlNodeComplexity();
BlamVersion def_engine = BlamVersion.Unknown;
s.ReadAttribute("game", ref def_engine);
if (def_engine != state.Definition.Engine)
{
Debug.Assert.If(false, "CheApe definition '{0}' is for {1}. Expected a {2} definition.", s.FileName, def_engine, state.Definition.Engine);
}
else
{
string name_str;
foreach (XmlNode n in s.Cursor.ChildNodes)
{
switch (n.Name)
{
#region Enums
case "enums":
s.SaveCursor(n);
foreach (XmlNode n2 in s.Cursor.ChildNodes)
{
if (n2.Name != "Enum") continue;
s.SaveCursor(n2);
StringList list = new StringList(state, s);
s.RestoreCursor();
name_str = list.ToString();
try { Enums.Add(name_str, list); }
catch (ArgumentException) { Debug.LogFile.WriteLine(kDuplicateErrorStr, "enum definition", name_str); }
}
s.RestoreCursor();
break;
#endregion
#region Flags
case "flags":
s.SaveCursor(n);
foreach (XmlNode n2 in s.Cursor.ChildNodes)
{
if (n2.Name != "Flag") continue;
s.SaveCursor(n2);
StringList list = new StringList(state, s);
s.RestoreCursor();
name_str = list.ToString();
try { Flags.Add(name_str, list); }
catch (ArgumentException) { Debug.LogFile.WriteLine(kDuplicateErrorStr, "flag definition", name_str); }
}
s.RestoreCursor();
break;
#endregion
#region Tag References
case "references":
s.SaveCursor(n);
foreach (XmlNode n2 in s.Cursor.ChildNodes)
{
if (n2.Name != "Reference") continue;
s.SaveCursor(n2);
TagReference tagref = new TagReference(state, s);
s.RestoreCursor();
name_str = tagref.ToString();
try { References.Add(name_str, tagref); }
catch (ArgumentException) { Debug.LogFile.WriteLine(kDuplicateErrorStr, "tag reference definition", name_str); }
}
s.RestoreCursor();
break;
#endregion
#region Tag Data
case "data":
s.SaveCursor(n);
foreach (XmlNode n2 in s.Cursor.ChildNodes)
{
if (n2.Name != "TagData") continue;
s.SaveCursor(n2);
TagData tagdata = new TagData(state, s);
s.RestoreCursor();
name_str = tagdata.ToString();
try { Data.Add(name_str, tagdata); }
catch (ArgumentException) { Debug.LogFile.WriteLine(kDuplicateErrorStr, "tag data definition", name_str); }
}
s.RestoreCursor();
break;
#endregion
#region Script Functions
//.........这里部分代码省略.........