本文整理汇总了C#中Writer.WriteUInt32方法的典型用法代码示例。如果您正苦于以下问题:C# Writer.WriteUInt32方法的具体用法?C# Writer.WriteUInt32怎么用?C# Writer.WriteUInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Writer
的用法示例。
在下文中一共展示了Writer.WriteUInt32方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Save
private void Save(object sender, RoutedEventArgs e)
{
using (var writer = new Writer(buffer))
{
foreach (Slot slot in Slots.Where(slot => slot.SlotRead))
{
int id = slot.SlotID;
SetStatus("Writing Slot# " + (id + 1));
_offset = (0x44 + (0x79400 * id));
try
{
//Name
SetStatus("Writing Name");
writer.Position = _offset + 4;
writer.WriteString(slot.Name, StringType.Ascii, 16);
//Money
SetStatus("Writing Money");
writer.Position = _offset + 64;
writer.WriteUInt32(slot.Money);
////Inventory
//Weapons
if (weapons.IsChecked == true)
{
writer.Position = _offset + 107;
writer.WriteHexString(
"636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363")
;
}
//Headgear
if (headgear.IsChecked == true)
{
writer.Position = _offset + 362;
writer.WriteHexString(
"63636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363")
;
}
if (bodywear.IsChecked == true)
{
writer.Position = _offset + 411;
writer.WriteHexString(
"6363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363")
;
}
if (armwear.IsChecked == true)
{
writer.Position = _offset + 473;
writer.WriteHexString(
"6363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363")
;
}
if (legwear.IsChecked == true)
{
writer.Position = _offset + 535;
writer.WriteHexString(
"6363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363")
;
}
if (pennon.IsChecked == true)
{
writer.Position = _offset + 597;
writer.WriteHexString(
"6363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363")
;
}
//Squad Writes
int counter = 0;
foreach (Squad squad in slot.Squads)
{
SetStatus("Writing " + (Squaddies)counter);
writer.Position = _offset + squad.Adjust;
writer.WriteUInt16(squad.Level);
writer.Position += 4;
writer.WriteUInt32(squad.Points);
counter++;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
SetStatus("ERROR!");
return;
}
SetStatus("Saved!");
writer.Flush();
}
}
_stfs.Replace(buffer, 0);
//Device ID
_stfs.HeaderData.DeviceID = DID.Text;
//Profile ID
_stfs.HeaderData.ProfileID = PID.Text;
//Console ID
_stfs.HeaderData.ConsoleID = CID.Text;
//.........这里部分代码省略.........