本文整理汇总了C#中ME3Explorer.Unreal.PCCObject.isName方法的典型用法代码示例。如果您正苦于以下问题:C# PCCObject.isName方法的具体用法?C# PCCObject.isName怎么用?C# PCCObject.isName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ME3Explorer.Unreal.PCCObject
的用法示例。
在下文中一共展示了PCCObject.isName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: detectStart
public static int detectStart(PCCObject pcc, byte[] raw)
{
int result = 8;
int test1 = BitConverter.ToInt32(raw, 4);
if (test1 < 0)
result = 30;
else
{
int test2 = BitConverter.ToInt32(raw, 8);
if (pcc.isName(test1) && test2 == 0)
result = 4;
if (pcc.isName(test1) && pcc.isName(test2) && test2 != 0)
result = 8;
}
return result;
}
示例2: ReadProp
public static List<Property> ReadProp(PCCObject pcc, byte[] raw, int start)
{
Property p;
PropertyValue v;
int sname;
List<Property> result = new List<Property>();
int pos = start;
if(raw.Length - pos < 8)
return result;
int name = (int)BitConverter.ToInt64(raw, pos);
if (!pcc.isName(name))
return result;
string t = pcc.Names[name];
if (pcc.Names[name] == "None")
{
p = new Property();
p.Name = name;
p.TypeVal = Type.None;
p.i = 0;
p.offsetval = pos;
p.Size = 8;
p.Value = new PropertyValue();
p.raw = BitConverter.GetBytes((Int64)name);
p.offend = pos + 8;
result.Add(p);
return result;
}
int type = (int)BitConverter.ToInt64(raw, pos + 8);
int size = BitConverter.ToInt32(raw, pos + 16);
int idx = BitConverter.ToInt32(raw, pos + 20);
if (!pcc.isName(type) || size < 0 || size >= raw.Length)
return result;
string tp = pcc.Names[type];
switch (tp)
{
case "DelegateProperty":
p = new Property();
p.Name = name;
p.TypeVal = Type.DelegateProperty;
p.i = 0;
p.offsetval = pos + 24;
v = new PropertyValue();
v.IntValue = BitConverter.ToInt32(raw, pos + 28);
v.len = size;
v.Array = new List<PropertyValue>();
pos += 24;
for (int i = 0; i < size; i++)
{
PropertyValue v2 = new PropertyValue();
if(pos < raw.Length)
v2.IntValue = raw[pos];
v.Array.Add(v2);
pos ++;
}
p.Value = v;
break;
case "ArrayProperty":
int count = (int)BitConverter.ToInt64(raw, pos + 24);
p = new Property();
p.Name = name;
p.TypeVal = Type.ArrayProperty;
p.i = 0;
p.offsetval = pos + 24;
v = new PropertyValue();
v.IntValue = type;
v.len = size - 4;
count = v.len;//TODO can be other objects too
v.Array = new List<PropertyValue>();
pos += 28;
for (int i = 0; i < count; i++)
{
PropertyValue v2 = new PropertyValue();
if(pos < raw.Length)
v2.IntValue = raw[pos];
v.Array.Add(v2);
pos ++;
}
p.Value = v;
break;
case "StrProperty":
count = (int)BitConverter.ToInt64(raw, pos + 24);
p = new Property();
p.Name = name;
p.TypeVal = Type.StrProperty;
p.i = 0;
p.offsetval = pos + 24;
count *= -1;
v = new PropertyValue();
v.IntValue = type;
v.len = count;
pos += 28;
string s = "";
for (int i = 0; i < count; i++)
{
s += (char)raw[pos];
pos += 2;
}
v.StringValue = s;
p.Value = v;
//.........这里部分代码省略.........