NHSE/NHSE.Core/Structures/Item/FieldItem/FieldItemKind.cs
Kurt 8582e96978
Initial v2.0.0 Support (#520)
* Initial save arrangement
* Add initial text dumps
* Update metadata
* Update offsets for main/personal, fix variation test -- items now internally labelled for no variation
* Add event flag labeling
* Add customization remake lookup entries
2021-11-03 21:28:18 -07:00

109 lines
2.9 KiB
C#

using static NHSE.Core.FieldItemKind;
namespace NHSE.Core
{
public enum FieldItemKind : byte
{
FenceBamboo,
FenceBarbedWire,
FenceChinese,
FenceConcreteBlock,
FenceCorrugatedIron,
FenceCrossedBamboo,
FenceDriedStraw,
FenceEasterEgg,
FenceGardenPegRope,
FenceHalloween,
FenceHorizontalLog,
FenceHorizontalWood,
FenceIce,
FenceIkegaki,
FenceIronAndStone,
FenceJapanese,
FenceJuneBride,
FenceLattice,
FenceLatticeBig,
FenceLog,
FenceLogWall,
FenceMermaid,
FencePark,
FencePegRope,
FenceSandProtection,
FenceSharply,
FenceSteel,
FenceStone,
FenceVerticalWood,
FenceWallRenga,
FenceWoodWhite,
LadderKitA,
LadderKitB,
LadderKitC,
LadderKitD,
PltBushAzalea,
PltBushCamellia,
PltBushHibiscus,
PltBushHolly,
PltBushHydrangea,
PltBushOsmanthus,
PltBushPlumeria,
PltFlwAnemone,
PltFlwCosmos,
PltFlwHyacinth,
PltFlwLily,
PltFlwMum,
PltFlwPansy,
PltFlwRose,
PltFlwRoseGold,
PltFlwTulip,
PltFlwYuri,
PltTreeBamboo,
PltTreeCedar,
PltTreeCedarDeco,
PltTreeOak,
PltTreePalm,
PltVgtCarrot,
PltVgtPotato,
PltVgtPumpkin,
PltVgtSugarcane,
PltVgtTomato,
PltVgtWheat,
PltVine,
PltWeedAut0,
PltWeedAut1,
PltWeedAut2,
PltWeedLight,
PltWeedSmr,
PltWeedSpr,
PltWeedWin0,
PltWeedWin1,
StoneA,
StoneB,
StoneC,
StoneD,
StoneE,
UnitIconHole,
}
public static class FieldItemKindExtensions
{
public static bool IsWeed(this FieldItemKind type) => type is >= PltWeedAut0 and <= PltWeedWin1;
public static bool IsPlant(this FieldItemKind type) => type is >= PltFlwAnemone and <= PltWeedWin1;
public static bool IsFence(this FieldItemKind type) => type is >= FenceBamboo and <= FenceWoodWhite;
public static bool IsBush(this FieldItemKind type) => type is >= PltBushAzalea and <= PltBushOsmanthus;
public static bool IsFlower(this FieldItemKind type) => type is >= PltFlwAnemone and <= PltFlwYuri;
public static bool IsTree(this FieldItemKind type) => type is >= PltTreeBamboo and <= PltTreePalm;
public static bool IsStone(this FieldItemKind type) => type is >= StoneA and <= StoneE;
public static ItemKind ToItemKind(this FieldItemKind type)
{
if (type.IsTree())
return ItemKind.Kind_Tree;
if (type.IsFlower())
return ItemKind.Kind_Flower;
if (type.IsWeed())
return ItemKind.Kind_Weed;
return ItemKind.Unknown;
}
}
}