本文整理汇总了C#中HaloMap.Meta.Meta.RelinkReferences方法的典型用法代码示例。如果您正苦于以下问题:C# Meta.RelinkReferences方法的具体用法?C# Meta.RelinkReferences怎么用?C# Meta.RelinkReferences使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HaloMap.Meta.Meta
的用法示例。
在下文中一共展示了Meta.RelinkReferences方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OverWrite
/// <summary>
/// The over write.
/// </summary>
/// <param name="map">The map.</param>
/// <param name="tagIndex">Index of the tag.</param>
/// <param name="newMeta">The new meta.</param>
/// <remarks></remarks>
public static void OverWrite(Map map, int tagIndex, ref Meta newMeta)
{
TagIndex = tagIndex;
if (map.MetaInfo.TagType[tagIndex] == "sbsp")
{
MessageBox.Show("Can't OverWrite The Bsp");
return;
}
newMeta.RelinkReferences();
ArrayList metas = new ArrayList(0);
map.OpenMap(MapTypes.Internal);
for (int x = 0; x < map.IndexHeader.metaCount; x++)
{
if (tagIndex == x)
{
newMeta.type = map.MetaInfo.TagType[x];
newMeta.name = map.FileNames.Name[x];
SizeOfShift = newMeta.size - map.MetaInfo.Size[x];
metas.Add(newMeta);
continue;
}
Meta m = new Meta(map);
m.ReadMetaFromMap(x, true);
try
{
IFPIO ifpx = IFPHashMap.GetIfp(m.type, map.HaloVersion);
m.headersize = ifpx.headerSize;
m.scanner.ScanWithIFP(ref ifpx);
// metaScanner.ScanManually(ref m, ref map);
metas.Add(m);
}
catch (System.Exception ex)
{
Globals.Global.ShowErrorMsg(string.Empty, ex);
}
}
FixReflexives(metas, map);
map.CloseMap();
}
示例2: BuildMeta
/// <summary>
/// The build meta.
/// </summary>
/// <param name="metasplit">The metasplit.</param>
/// <param name="map">The map.</param>
/// <returns></returns>
/// <remarks></remarks>
public static Meta BuildMeta(MetaSplitter metasplit, Map map)
{
metasize = 0;
MetaStream = new MemoryStream(metasplit.Header.chunksize);
BinaryWriter BW = new BinaryWriter(MetaStream);
// BW.BaseStream.Position = 0;
// BW.Write(metasplit.Header.MS.ToArray(), 0, metasplit.Header.chunksize);
metasize += metasplit.Header.chunksize;
TagIndex = metasplit.TagIndex;
Meta m = new Meta(map);
List<Meta.Item> NewItems = new List<Meta.Item>();
// Major error here! Size is not calculated right!
RecursivelyAddPiecesToMeta(metasplit.Header, ref NewItems, ref BW);
m.items = NewItems;
if (MetaStream.Length % 4 != 0)
{
metasize += (int)MetaStream.Length % 4;
MetaStream.SetLength(MetaStream.Length + MetaStream.Length % 4);
}
m.MS = MetaStream;
m.size = metasize;
m.type = metasplit.type;
m.name = metasplit.name;
m.rawType = metasplit.rawtype;
m.raw = metasplit.raw;
m.magic = metasplit.magic;
m.offset = metasplit.offset;
m.TagIndex = TagIndex;
m.RelinkReferences();
m.WriteReferences();
// m.items.Clear();
// MetaScanner Ms = new MetaScanner();
if (m.rawType != RawDataContainerType.Empty)
{
map.OpenMap(MapTypes.Internal);
m.raw = map.Functions.ForMeta.ReadRaw(m.TagIndex, false);
map.CloseMap();
}
// map.OpenMap(MapTypes.Internal);
// IFPIO ifp=IFP.IFPHashMap.GetIfp(m.type);
// m.parsed = true;
// Ms.ScanWithIFP(ref ifp, ref m, map) ;
// map.CloseMap();
return m;
}