Some early glamourer changes.

This commit is contained in:
Ottermandias 2022-07-21 10:07:52 +02:00
parent c2bc8252f1
commit 9dee0862cc
17 changed files with 192 additions and 840 deletions

View file

@ -1,10 +1,14 @@
using System;
using System.Runtime.InteropServices;
namespace Penumbra.GameData.Structs;
[StructLayout( LayoutKind.Explicit, Pack = 1 )]
public readonly struct CharacterArmor
public readonly struct CharacterArmor : IEquatable< CharacterArmor >
{
[FieldOffset( 0 )]
public readonly uint Value;
[FieldOffset( 0 )]
public readonly SetId Set;
@ -14,9 +18,31 @@ public readonly struct CharacterArmor
[FieldOffset( 3 )]
public readonly StainId Stain;
[FieldOffset( 0 )]
public readonly uint Value;
public CharacterArmor( SetId set, byte variant, StainId stain )
{
Value = 0;
Set = set;
Variant = variant;
Stain = stain;
}
public override string ToString()
=> $"{Set},{Variant},{Stain}";
public static readonly CharacterArmor Empty;
public bool Equals( CharacterArmor other )
=> Value == other.Value;
public override bool Equals( object? obj )
=> obj is CharacterArmor other && Equals( other );
public override int GetHashCode()
=> ( int )Value;
public static bool operator ==( CharacterArmor left, CharacterArmor right )
=> left.Value == right.Value;
public static bool operator !=( CharacterArmor left, CharacterArmor right )
=> left.Value != right.Value;
}