mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-13 12:14:17 +01:00
Add some improvements to game path stuff, move the race inheritance tree to game data, etc.
This commit is contained in:
parent
b50ed4b99a
commit
f1b495dff4
8 changed files with 607 additions and 320 deletions
50
Penumbra.GameData/Structs/ImcEntry.cs
Normal file
50
Penumbra.GameData/Structs/ImcEntry.cs
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Penumbra.GameData.Structs;
|
||||
|
||||
public readonly struct ImcEntry : IEquatable<ImcEntry>
|
||||
{
|
||||
public byte MaterialId { get; init; }
|
||||
public byte DecalId { get; init; }
|
||||
public readonly ushort AttributeAndSound;
|
||||
public byte VfxId { get; init; }
|
||||
public byte MaterialAnimationId { get; init; }
|
||||
|
||||
public ushort AttributeMask
|
||||
{
|
||||
get => (ushort)(AttributeAndSound & 0x3FF);
|
||||
init => AttributeAndSound = (ushort)((AttributeAndSound & ~0x3FF) | (value & 0x3FF));
|
||||
}
|
||||
|
||||
public byte SoundId
|
||||
{
|
||||
get => (byte)(AttributeAndSound >> 10);
|
||||
init => AttributeAndSound = (ushort)(AttributeMask | (value << 10));
|
||||
}
|
||||
|
||||
public bool Equals(ImcEntry other)
|
||||
=> MaterialId == other.MaterialId
|
||||
&& DecalId == other.DecalId
|
||||
&& AttributeAndSound == other.AttributeAndSound
|
||||
&& VfxId == other.VfxId
|
||||
&& MaterialAnimationId == other.MaterialAnimationId;
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
=> obj is ImcEntry other && Equals(other);
|
||||
|
||||
public override int GetHashCode()
|
||||
=> HashCode.Combine(MaterialId, DecalId, AttributeAndSound, VfxId, MaterialAnimationId);
|
||||
|
||||
[JsonConstructor]
|
||||
public ImcEntry(byte materialId, byte decalId, ushort attributeMask, byte soundId, byte vfxId, byte materialAnimationId)
|
||||
{
|
||||
MaterialId = materialId;
|
||||
DecalId = decalId;
|
||||
AttributeAndSound = 0;
|
||||
VfxId = vfxId;
|
||||
MaterialAnimationId = materialAnimationId;
|
||||
AttributeMask = attributeMask;
|
||||
SoundId = soundId;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue