mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-13 12:14:17 +01:00
Some early glamourer changes.
This commit is contained in:
parent
c2bc8252f1
commit
9dee0862cc
17 changed files with 192 additions and 840 deletions
|
|
@ -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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue