mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Move Entries to GameData.
This commit is contained in:
parent
4cfd7f56c0
commit
b93c5376de
12 changed files with 71 additions and 60 deletions
|
|
@ -1,9 +1,8 @@
|
|||
using System;
|
||||
using System.ComponentModel;
|
||||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.Meta;
|
||||
|
||||
namespace Penumbra.Game
|
||||
namespace Penumbra.GameData.Structs
|
||||
{
|
||||
[Flags]
|
||||
public enum EqdpEntry : ushort
|
||||
|
|
@ -105,24 +104,4 @@ namespace Penumbra.Game
|
|||
};
|
||||
}
|
||||
}
|
||||
|
||||
public static class EqdpEntryExtension
|
||||
{
|
||||
public static bool Apply( this ref EqdpEntry entry, MetaManipulation manipulation )
|
||||
{
|
||||
if( manipulation.Type != MetaType.Eqdp )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var mask = Eqdp.Mask( manipulation.EqdpIdentifier.Slot );
|
||||
var result = ( entry & ~mask ) | manipulation.EqdpValue;
|
||||
var ret = result == entry;
|
||||
entry = result;
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static EqdpEntry Reduce( this EqdpEntry entry, EquipSlot slot )
|
||||
=> entry & Eqdp.Mask( slot );
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +1,8 @@
|
|||
using System;
|
||||
using System.ComponentModel;
|
||||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.Meta;
|
||||
|
||||
namespace Penumbra.Game
|
||||
namespace Penumbra.GameData.Structs
|
||||
{
|
||||
[Flags]
|
||||
public enum EqpEntry : ulong
|
||||
|
|
@ -128,24 +127,4 @@ namespace Penumbra.Game
|
|||
};
|
||||
}
|
||||
}
|
||||
|
||||
public static class EqpEntryExtension
|
||||
{
|
||||
public static bool Apply( this ref EqpEntry entry, MetaManipulation manipulation )
|
||||
{
|
||||
if( manipulation.Type != MetaType.Eqp )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var mask = Eqp.Mask( manipulation.EqpIdentifier.Slot );
|
||||
var result = ( entry & ~mask ) | manipulation.EqpValue;
|
||||
var ret = result != entry;
|
||||
entry = result;
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static EqpEntry Reduce( this EqpEntry entry, EquipSlot slot )
|
||||
=> entry & Eqp.Mask( slot );
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
using System.IO;
|
||||
using Penumbra.Meta;
|
||||
|
||||
namespace Penumbra.Game
|
||||
namespace Penumbra.GameData.Structs
|
||||
{
|
||||
public struct GmpEntry
|
||||
{
|
||||
|
|
@ -89,16 +88,5 @@ namespace Penumbra.Game
|
|||
|
||||
public static explicit operator GmpEntry( ulong entry )
|
||||
=> new() { Value = entry };
|
||||
|
||||
public GmpEntry Apply( MetaManipulation manipulation )
|
||||
{
|
||||
if( manipulation.Type != MetaType.Gmp )
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
Value = manipulation.GmpValue.Value;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@ using System.IO;
|
|||
using System.Runtime.InteropServices;
|
||||
using Penumbra.GameData.Enums;
|
||||
|
||||
namespace Penumbra.Game
|
||||
namespace Penumbra.GameData.Structs
|
||||
{
|
||||
[StructLayout( LayoutKind.Sequential, Pack = 1 )]
|
||||
public readonly struct RspEntry
|
||||
|
|
@ -6,6 +6,7 @@ using Dalamud.Plugin;
|
|||
using Lumina.Data.Files;
|
||||
using Penumbra.Game;
|
||||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.GameData.Structs;
|
||||
using Penumbra.GameData.Util;
|
||||
using Penumbra.Meta;
|
||||
using Penumbra.Meta.Files;
|
||||
|
|
|
|||
60
Penumbra/Meta/EntryExtensions.cs
Normal file
60
Penumbra/Meta/EntryExtensions.cs
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.GameData.Structs;
|
||||
|
||||
namespace Penumbra.Meta
|
||||
{
|
||||
public static class EqdpEntryExtensions
|
||||
{
|
||||
public static bool Apply( this ref EqdpEntry entry, MetaManipulation manipulation )
|
||||
{
|
||||
if( manipulation.Type != MetaType.Eqdp )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var mask = Eqdp.Mask( manipulation.EqdpIdentifier.Slot );
|
||||
var result = ( entry & ~mask ) | manipulation.EqdpValue;
|
||||
var ret = result == entry;
|
||||
entry = result;
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static EqdpEntry Reduce( this EqdpEntry entry, EquipSlot slot )
|
||||
=> entry & Eqdp.Mask( slot );
|
||||
}
|
||||
|
||||
|
||||
public static class EqpEntryExtensions
|
||||
{
|
||||
public static bool Apply( this ref EqpEntry entry, MetaManipulation manipulation )
|
||||
{
|
||||
if( manipulation.Type != MetaType.Eqp )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var mask = Eqp.Mask( manipulation.EqpIdentifier.Slot );
|
||||
var result = ( entry & ~mask ) | manipulation.EqpValue;
|
||||
var ret = result != entry;
|
||||
entry = result;
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static EqpEntry Reduce( this EqpEntry entry, EquipSlot slot )
|
||||
=> entry & Eqp.Mask( slot );
|
||||
}
|
||||
|
||||
public static class GmpEntryExtension
|
||||
{
|
||||
public static GmpEntry Apply( this GmpEntry entry, MetaManipulation manipulation )
|
||||
{
|
||||
if( manipulation.Type != MetaType.Gmp )
|
||||
{
|
||||
return entry;
|
||||
}
|
||||
|
||||
entry.Value = manipulation.GmpValue.Value;
|
||||
return entry;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@ using System.IO;
|
|||
using System.Linq;
|
||||
using Penumbra.Game;
|
||||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.GameData.Structs;
|
||||
|
||||
namespace Penumbra.Meta.Files
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ using System;
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using Lumina.Data;
|
||||
using Penumbra.Game;
|
||||
using Penumbra.GameData.Structs;
|
||||
|
||||
namespace Penumbra.Meta.Files
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using System.IO;
|
|||
using System.Linq;
|
||||
using Lumina.Data;
|
||||
using Penumbra.Game;
|
||||
using Penumbra.GameData.Structs;
|
||||
|
||||
namespace Penumbra.Meta.Files
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using Lumina.Data;
|
||||
using Penumbra.Game;
|
||||
using Penumbra.GameData.Structs;
|
||||
|
||||
namespace Penumbra.Meta.Files
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ using System.ComponentModel;
|
|||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using Newtonsoft.Json;
|
||||
using Penumbra.Game;
|
||||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.GameData.Structs;
|
||||
using Penumbra.GameData.Util;
|
||||
using Penumbra.Meta.Files;
|
||||
using Swan;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ using ImGuiNET;
|
|||
using Lumina.Data.Files;
|
||||
using Penumbra.Game;
|
||||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.GameData.Structs;
|
||||
using Penumbra.Meta;
|
||||
using Penumbra.Meta.Files;
|
||||
using Penumbra.Util;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue