mirror of
https://github.com/kwsch/NHSE.git
synced 2026-05-01 02:56:59 -05:00
85 lines
2.4 KiB
C#
85 lines
2.4 KiB
C#
using static NHSE.Core.FieldItemKind;
|
|
|
|
namespace NHSE.Core
|
|
{
|
|
public enum FieldItemKind : byte
|
|
{
|
|
FenceBamboo,
|
|
FenceBarbedWire,
|
|
FenceChinese,
|
|
FenceDriedStraw,
|
|
FenceEasterEgg,
|
|
FenceHorizontalLog,
|
|
FenceHorizontalWood,
|
|
FenceIkegaki,
|
|
FenceIronAndStone,
|
|
FenceJapanese,
|
|
FenceJuneBride,
|
|
FenceLattice,
|
|
FenceLog,
|
|
FencePegRope,
|
|
FenceSharply,
|
|
FenceSteel,
|
|
FenceStone,
|
|
FenceVerticalWood,
|
|
FenceWallRenga,
|
|
FenceWoodWhite,
|
|
PltBushAzalea,
|
|
PltBushCamellia,
|
|
PltBushHibiscus,
|
|
PltBushHolly,
|
|
PltBushHydrangea,
|
|
PltBushOsmanthus,
|
|
PltFlwAnemone,
|
|
PltFlwCosmos,
|
|
PltFlwHyacinth,
|
|
PltFlwLily,
|
|
PltFlwMum,
|
|
PltFlwPansy,
|
|
PltFlwRose,
|
|
PltFlwRoseGold,
|
|
PltFlwTulip,
|
|
PltFlwYuri,
|
|
PltTreeBamboo,
|
|
PltTreeCedar,
|
|
PltTreeCedarDeco,
|
|
PltTreeOak,
|
|
PltTreePalm,
|
|
PltWeedAut0,
|
|
PltWeedAut1,
|
|
PltWeedAut2,
|
|
PltWeedSmr,
|
|
PltWeedSpr,
|
|
PltWeedWin0,
|
|
PltWeedWin1,
|
|
StoneA,
|
|
StoneB,
|
|
StoneC,
|
|
StoneD,
|
|
StoneE,
|
|
UnitIconHole,
|
|
}
|
|
|
|
public static class FieldItemKindExtensions
|
|
{
|
|
public static bool IsWeed(this FieldItemKind type) => PltWeedAut0 <= type && type <= PltWeedWin1;
|
|
public static bool IsPlant(this FieldItemKind type) => PltFlwAnemone <= type && type <= PltWeedWin1;
|
|
public static bool IsFence(this FieldItemKind type) => FenceBamboo <= type && type <= FenceWoodWhite;
|
|
public static bool IsBush(this FieldItemKind type) => PltBushAzalea <= type && type <= PltBushOsmanthus;
|
|
public static bool IsFlower(this FieldItemKind type) => PltFlwAnemone <= type && type <= PltFlwYuri;
|
|
public static bool IsTree(this FieldItemKind type) => PltTreeBamboo <= type && type <= PltTreePalm;
|
|
public static bool IsStone(this FieldItemKind type) => StoneA <= type && type <= 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;
|
|
}
|
|
}
|
|
}
|