Condense some expressions

This commit is contained in:
Kurt
2026-01-16 00:29:38 -06:00
parent 90f71c6dee
commit d276527404
6 changed files with 11 additions and 115 deletions

View File

@@ -6,44 +6,13 @@
/// <remarks>
/// These details are extracted from FgMainParam.bcsv
/// </remarks>
public class FieldItemDefinition : INamedValue
/// <param name="Index">Item ID</param>
/// <param name="Dig">Item ID that the player receives if the item is dug up. Is <see cref="Item.NONE"/> if it cannot be dug up.</param>
/// <param name="Pick">Item ID that the player receives if the item is picked up. Is <see cref="Item.NONE"/> if it cannot be picked up.</param>
/// <param name="Name">Internal Name of the Item</param>
/// <param name="Kind">Classification of item.</param>
public sealed record FieldItemDefinition(ushort Index, ushort Dig, ushort Pick, string Name, FieldItemKind Kind) : INamedValue
{
/// <summary>
/// Item ID
/// </summary>
public ushort Index { get; }
/// <summary>
/// Internal Name of the Item
/// </summary>
public string Name { get; }
/// <summary>
/// Item ID that the player receives if the item is dug up.
/// </summary>
/// <remarks>Is <see cref="Item.NONE"/> if it cannot be dug up.</remarks>
public readonly ushort Dig;
/// <summary>
/// Item ID that the player receives if the item is dug up.
/// </summary>
/// <remarks>Is <see cref="Item.NONE"/> if it cannot be picked up.</remarks>
public readonly ushort Pick;
/// <summary>
/// Classification of item.
/// </summary>
public readonly FieldItemKind Kind;
public FieldItemDefinition(ushort id, ushort dig, ushort pick, string name, FieldItemKind kind)
{
Index = id;
Dig = dig;
Pick = pick;
Name = name;
Kind = kind;
}
/// <summary>
/// When the field item is picked up, this is the held item ID.
/// </summary>

View File

@@ -2,23 +2,8 @@
namespace NHSE.Core;
public class EventFlagHouse : INamedValue
public sealed record EventFlagHouse(short DefaultValue, short MaxValue, ushort Index, string Name) : INamedValue
{
// these are actually unsigned
public readonly short DefaultValue;
public readonly short MaxValue;
public ushort Index { get; }
public string Name { get; }
public EventFlagHouse(short init, short max, ushort index, string name)
{
Name = name;
Index = index;
DefaultValue = init;
MaxValue = max;
}
public static readonly IReadOnlyDictionary<ushort, EventFlagHouse> List = new Dictionary<ushort, EventFlagHouse>
{
{0x001, new EventFlagHouse(0, 1 , 0001, "HouseOrder1" )}, // テント→6x6増築申込

View File

@@ -2,23 +2,8 @@
namespace NHSE.Core;
public class EventFlagLand : INamedValue
public sealed record EventFlagLand(short DefaultValue, short MaxValue, ushort Index, string Name) : INamedValue
{
// these are actually unsigned
public readonly short DefaultValue;
public readonly short MaxValue;
public ushort Index { get; }
public string Name { get; }
public EventFlagLand(short init, short max, ushort index, string name)
{
Name = name;
Index = index;
DefaultValue = init;
MaxValue = max;
}
public static readonly IReadOnlyDictionary<ushort, EventFlagLand> List = new Dictionary<ushort, EventFlagLand>
{
{0x000, new EventFlagLand(0 , 1 , 0000, "TodayCreateVillage" )}, // 今日村作成されたか

View File

@@ -3,23 +3,8 @@
namespace NHSE.Core;
public class EventFlagPlayer : INamedValue
public sealed record EventFlagPlayer(short DefaultValue, short MaxValue, ushort Index, string Name) : INamedValue
{
// these are actually unsigned
public readonly short DefaultValue;
public readonly short MaxValue;
public ushort Index { get; }
public string Name { get; }
public EventFlagPlayer(short init, short max, ushort index, string name)
{
Name = name;
Index = index;
DefaultValue = init;
MaxValue = max;
}
public static readonly IReadOnlyDictionary<ushort, EventFlagPlayer> List = new Dictionary<ushort, EventFlagPlayer>
{
{0x002, new EventFlagPlayer(0 , 9 , 0002, "PrologueNpcHintCount" )}, // NPCの序盤ヒントをいくつまで聞いたか

View File

@@ -3,22 +3,8 @@
namespace NHSE.Core;
public class EventFlagVillager : INamedValue
public sealed record EventFlagVillager(short Value1, short Value2, ushort Index, string Name) : INamedValue
{
public readonly short Value1;
public readonly short Value2;
public ushort Index { get; }
public string Name { get; }
public EventFlagVillager(short v1, short v2, ushort index, string name)
{
Name = name;
Index = index;
Value1 = v1;
Value2 = v2;
}
public static readonly IReadOnlyDictionary<ushort, EventFlagVillager> List = new Dictionary<ushort, EventFlagVillager>
{
{0x000, new EventFlagVillager(0 , 200 , 0000, "NnpcHouseLoan" )}, // ローン返済カウント

View File

@@ -2,22 +2,8 @@
namespace NHSE.Core;
public class EventFlagVillagerMemoryPlayer : INamedValue
public sealed record EventFlagVillagerMemoryPlayer(byte Initial, byte Maximum, ushort Index, string Name) : INamedValue
{
public readonly byte Initial;
public readonly byte Maximum;
public ushort Index { get; }
public string Name { get; }
public EventFlagVillagerMemoryPlayer(byte init, byte max, ushort index, string name)
{
Name = name;
Index = index;
Initial = init;
Maximum = max;
}
public static readonly IReadOnlyDictionary<ushort, EventFlagVillagerMemoryPlayer> List = new Dictionary<ushort, EventFlagVillagerMemoryPlayer>
{
{0x00, new EventFlagVillagerMemoryPlayer(0 , 1 , 000, "TalkFreeMultiDayEventNow" )}, // ボツ今、期間型イベント用のFreeFを聞いたか