本文整理汇总了C#中ObjectData.Select方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectData.Select方法的具体用法?C# ObjectData.Select怎么用?C# ObjectData.Select使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectData
的用法示例。
在下文中一共展示了ObjectData.Select方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadRoomCore
//.........这里部分代码省略.........
{
room.Image = ReadImage(ms, room.Header.Width / 8);
}
}
break;
case "EN":
{
// Entry script
room.EntryScript.Data = _reader.ReadBytes((int)(it.Current.Size - 6));
}
break;
case "EX":
{
// Exit script
room.ExitScript.Data = _reader.ReadBytes((int)(it.Current.Size - 6));
}
break;
case "LC": //LC
{
// *NLSC* number of local scripts
var num = _reader.ReadUInt16();
}
break;
case "LS":
{
// local scripts
var index = _reader.ReadByte();
var pos = _reader.BaseStream.Position;
room.LocalScripts[index - 0xC8] = new ScriptData
{
Offset = pos - offset - 8,
Data = _reader.ReadBytes((int)(it.Current.Size - 7))
};
}
break;
case "OI":
{
// Object Image
var objId = _reader.ReadUInt16();
if (it.Current.Size > 8)
{
var img = _reader.ReadBytes((int)(it.Current.Size - 6));
objImages.Add(objId, img);
}
}
break;
case "OC":
{
// Object script
var objId = _reader.ReadUInt16();
var t = _reader.ReadByte();
System.Diagnostics.Debug.WriteLine("objId={0}: {1}", objId, t);
var x = _reader.ReadByte();
var tmp = _reader.ReadByte();
var y = tmp & 0x7F;
byte parentState = (byte)(((tmp & 0x80) != 0) ? 1 : 0);
var width = _reader.ReadByte();
var parent = _reader.ReadByte();
var walk_x = _reader.ReadInt16();
var walk_y = _reader.ReadInt16();
tmp = _reader.ReadByte();
byte height = (byte)(tmp & 0xF8);
byte actordir = (byte)(tmp & 0x07);
var data = new ObjectData(objId);
data.Position = new Point((short)(8 * x), (short)(8 * y));
data.Width = (ushort)(8 * width);
data.Height = height;
data.Parent = parent;
data.ParentState = parentState;
data.Walk = new Point(walk_x, walk_y);
data.ActorDir = actordir;
room.Objects.Add(data);
var nameOffset = _reader.ReadByte();
var size = nameOffset - 6 - 13;
ReadVerbTable(data, size);
data.Name = ReadObjectName(it, nameOffset);
// read script
size = (int)(it.Current.Offset + it.Current.Size - 6 - _reader.BaseStream.Position);
data.Script.Data = _reader.ReadBytes(size);
data.Script.Offset = nameOffset + data.Name.Length + 1;
SetObjectImage(room.Image.ZPlanes.Count, objImages, data);
}
break;
default:
{
var data = _reader.ReadBytes((int)it.Current.Size - 6);
System.Diagnostics.Debug.WriteLine("Ignoring Resource Tag: {0} (0x{1:X2}{2:X2}) [{3}]",
it.Current.Tag, (int)it.Current.Tag[0], (int)it.Current.Tag[1],
string.Join(",", data.Select(b => b.ToString("X2"))));
}
break;
}
}
return room;
}