mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Use external library for API interface and IPC.
This commit is contained in:
parent
b3f048bfe6
commit
918d5db6a6
69 changed files with 4026 additions and 1873 deletions
32
Penumbra.GameData/Enums/ChangedItemExtensions.cs
Normal file
32
Penumbra.GameData/Enums/ChangedItemExtensions.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using Lumina.Excel.GeneratedSheets;
|
||||
using Penumbra.Api.Enums;
|
||||
using Action = Lumina.Excel.GeneratedSheets.Action;
|
||||
|
||||
namespace Penumbra.GameData.Enums;
|
||||
|
||||
public static class ChangedItemExtensions
|
||||
{
|
||||
public static (ChangedItemType, uint) ChangedItemToTypeAndId( object? item )
|
||||
{
|
||||
return item switch
|
||||
{
|
||||
null => ( ChangedItemType.None, 0 ),
|
||||
Item i => ( ChangedItemType.Item, i.RowId ),
|
||||
Action a => ( ChangedItemType.Action, a.RowId ),
|
||||
_ => ( ChangedItemType.Customization, 0 ),
|
||||
};
|
||||
}
|
||||
|
||||
public static object? GetObject( this ChangedItemType type, uint id )
|
||||
{
|
||||
return type switch
|
||||
{
|
||||
ChangedItemType.None => null,
|
||||
ChangedItemType.Item => ObjectIdentification.DataManager?.GetExcelSheet< Item >()?.GetRow( id ),
|
||||
ChangedItemType.Action => ObjectIdentification.DataManager?.GetExcelSheet< Action >()?.GetRow( id ),
|
||||
ChangedItemType.Customization => null,
|
||||
_ => throw new ArgumentOutOfRangeException( nameof( type ), type, null ),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
using System;
|
||||
using Lumina.Excel.GeneratedSheets;
|
||||
using Action = Lumina.Excel.GeneratedSheets.Action;
|
||||
|
||||
namespace Penumbra.GameData.Enums
|
||||
{
|
||||
public enum ChangedItemType
|
||||
{
|
||||
None,
|
||||
Item,
|
||||
Action,
|
||||
Customization,
|
||||
}
|
||||
|
||||
public static class ChangedItemExtensions
|
||||
{
|
||||
public static (ChangedItemType, uint) ChangedItemToTypeAndId( object? item )
|
||||
{
|
||||
return item switch
|
||||
{
|
||||
null => ( ChangedItemType.None, 0 ),
|
||||
Item i => ( ChangedItemType.Item, i.RowId ),
|
||||
Action a => ( ChangedItemType.Action, a.RowId ),
|
||||
_ => ( ChangedItemType.Customization, 0 ),
|
||||
};
|
||||
}
|
||||
|
||||
public static object? GetObject( this ChangedItemType type, uint id )
|
||||
{
|
||||
return type switch
|
||||
{
|
||||
ChangedItemType.None => null,
|
||||
ChangedItemType.Item => ObjectIdentification.DataManager?.GetExcelSheet< Item >()?.GetRow( id ),
|
||||
ChangedItemType.Action => ObjectIdentification.DataManager?.GetExcelSheet< Action >()?.GetRow( id ),
|
||||
ChangedItemType.Customization => null,
|
||||
_ => throw new ArgumentOutOfRangeException( nameof( type ), type, null )
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
namespace Penumbra.GameData.Enums
|
||||
{
|
||||
public enum MouseButton
|
||||
{
|
||||
None,
|
||||
Left,
|
||||
Right,
|
||||
Middle,
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
namespace Penumbra.GameData.Enums;
|
||||
|
||||
public enum RedrawType
|
||||
{
|
||||
Redraw,
|
||||
AfterGPose,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue