mirror of
https://github.com/kwsch/NHSE.git
synced 2026-04-25 07:37:02 -05:00
Add additional property accessors for room
unused in logic
This commit is contained in:
parent
37176b5a1a
commit
56c1cc31da
19
NHSE.Core/Structures/Misc/GSaveAudioInfo.cs
Normal file
19
NHSE.Core/Structures/Misc/GSaveAudioInfo.cs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
using System.ComponentModel;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
#pragma warning disable CS8618, CA1815, CA1819, IDE1006
|
||||
namespace NHSE.Core
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 2, Size = SIZE)]
|
||||
[TypeConverter(typeof(ValueTypeTypeConverter))]
|
||||
public struct GSaveAudioInfo
|
||||
{
|
||||
public const int SIZE = 0x4;
|
||||
|
||||
public short PlayingAudioMusicID { get; set; }
|
||||
public sbyte Unknown { get; set; }
|
||||
|
||||
[field: MarshalAs(UnmanagedType.I1, SizeConst = 1)]
|
||||
public bool IsShuffle { get; set; }
|
||||
};
|
||||
}
|
||||
|
|
@ -19,5 +19,20 @@ public class PlayerRoom
|
|||
public const int LayerCount = 8;
|
||||
public RoomItemLayer[] GetItemLayers() => RoomItemLayer.GetArray(Data.Slice(0, LayerCount * RoomItemLayer.SIZE));
|
||||
public void SetItemLayers(IReadOnlyList<RoomItemLayer> value) => RoomItemLayer.SetArray(value).CopyTo(Data, 0);
|
||||
|
||||
public bool GetIsActive(int layer, int x, int y) => FlagUtil.GetFlag(Data, 0x6400 + (layer * 0x34), (y * 20) + x);
|
||||
public void SetIsActive(int layer, int x, int y, bool value = true) => FlagUtil.SetFlag(Data, 0x6400 + (layer * 0x34), (y * 20) + x, value);
|
||||
|
||||
public GSaveAudioInfo AudioInfo
|
||||
{
|
||||
get => Data.Slice(0x65A0, GSaveAudioInfo.SIZE).ToStructure<GSaveAudioInfo>();
|
||||
set => value.ToBytes().CopyTo(Data, 0x65A0);
|
||||
}
|
||||
|
||||
public GSaveRoomFloorWall RoomFloorWall
|
||||
{
|
||||
get => Data.Slice(0x65A4, GSaveRoomFloorWall.SIZE).ToStructure<GSaveRoomFloorWall>();
|
||||
set => value.ToBytes().CopyTo(Data, 0x65A4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ public class FancyMarshalTests
|
|||
[Fact] public void MarshalHandwriting() => MarshalBytesTestS<Handwriting>(Handwriting.SIZE);
|
||||
|
||||
[Fact] public void MarshalGSaveRoomFloorWall() => MarshalBytesTestS<GSaveRoomFloorWall>(GSaveRoomFloorWall.SIZE);
|
||||
[Fact] public void MarshalGSaveAudioInfo() => MarshalBytesTestS<GSaveAudioInfo>(GSaveAudioInfo.SIZE);
|
||||
|
||||
[Fact] public void MarshalGSaveManpu() => MarshalBytesTestS<GSavePlayerManpu>(GSavePlayerManpu.SIZE);
|
||||
[Fact] public void MarshalGSavePlayerHandleName() => MarshalBytesTestS<GSavePlayerHandleName>(GSavePlayerHandleName.SIZE);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user