本文整理汇总了C#中HaloMap.Meta.Meta.SortItemsByOffset方法的典型用法代码示例。如果您正苦于以下问题:C# Meta.SortItemsByOffset方法的具体用法?C# Meta.SortItemsByOffset怎么用?C# Meta.SortItemsByOffset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HaloMap.Meta.Meta
的用法示例。
在下文中一共展示了Meta.SortItemsByOffset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SaveRecursiveFunction
//.........这里部分代码省略.........
Item i = null;
try
{
for (int x = 0; x < meta.items.Count; x++)
{
i = meta.items[x];
if (i.type != ItemType.Ident)
{
continue;
}
float currentpercentage = percent + (currentpercentsize * x);
pb.Value = (int)currentpercentage;
Application.DoEvents();
Ident id = (Ident)i;
if (id.ident == -1)
{
continue;
}
if (id.ident == 0)
{
int tagIndex = Map.Functions.ForMeta.FindByNameAndTagType("sbsp", i.intagname);
id.ident = Map.MetaInfo.Ident[tagIndex];
}
bool exists = false;
for (int e = 0; e < metas.Count; e++)
{
Meta tempmeta = (Meta)metas[e];
// if (id.pointstotagtype ==tempmeta.type&&id.pointstotagname ==tempmeta.name )
if (id.ident == tempmeta.ident)
{
exists = true;
break;
}
}
if (exists)
{
continue;
}
// Drag & drop w/ recursive locks up. num == -1
int num = Map.Functions.ForMeta.FindMetaByID(id.ident);
if (num < 0)
{
MessageBox.Show("ERROR! Not Found!");
}
Meta m = new Meta(Map);
if (parsed)
{
m.parsed = true;
}
m.ReadMetaFromMap(num, false);
if (m.type == "ltmp" | m.type == "matg")
{
continue;
}
if (m.type == "phmo" | m.type == "coll" | m.type == "jmad")
{
m.parsed = false;
}
if (m.type != "jmad")
{
IFPIO ifp = IFPHashMap.GetIfp(m.type, Map.HaloVersion);
m.headersize = ifp.headerSize;
m.scanner.ScanWithIFP(ref ifp);
}
else
{
m.scanner.ScanManually();
}
m.SortItemsByOffset();
metas.Add(m);
Application.DoEvents();
SaveRecursiveFunction(m, ref metas, parsed, pb, currentpercentage, currentpercentsize);
}
}
catch (Exception e)
{
string addOn = "\nin [" + meta.type + "] " + meta.name;
if (i.type == ItemType.Ident)
addOn = "\n" + i.description + ", Ident: " + ((Ident)i).ident + addOn;
throw new Exception(e.Message + addOn, e.InnerException);
}
}
示例2: GetMetaFromTagIndex
/// <summary>
/// The get meta from tag index.
/// </summary>
/// <param name="tag">The tag.</param>
/// <param name="map">The map.</param>
/// <param name="manualScan">The manual scan.</param>
/// <param name="parse">The parse.</param>
/// <returns></returns>
/// <remarks></remarks>
public static Meta GetMetaFromTagIndex(int tag, Map map, bool manualScan, bool parse)
{
map.OpenMap(MapTypes.Internal);
Meta meta = new Meta(map);
meta.TagIndex = tag;
meta.ScanMetaItems(manualScan, parse);
map.CloseMap();
meta.SortItemsByOffset();
return meta;
}