0
0
Fork 0
mirror of https://github.com/GreemDev/Ryujinx.git synced 2024-12-24 00:25:48 +00:00
Ryujinx/Ryujinx.HLE/Utilities/StructWriter.cs

31 lines
644 B
C#
Raw Normal View History

using Ryujinx.Cpu;
using System.Runtime.InteropServices;
namespace Ryujinx.HLE.Utilities
{
class StructWriter
{
private MemoryManager _memory;
public long Position { get; private set; }
public StructWriter(MemoryManager memory, long position)
{
_memory = memory;
Position = position;
}
public void Write<T>(T value) where T : struct
{
MemoryHelper.Write(_memory, Position, value);
Position += Marshal.SizeOf<T>();
}
public void SkipBytes(long count)
{
Position += count;
}
}
}