From 9d080e3b83e0c7b961c839dbc4bef9f1c7deb953 Mon Sep 17 00:00:00 2001 From: ikpil Date: Thu, 15 Jun 2023 18:27:19 +0900 Subject: [PATCH] add ofidx --- src/DotRecast.Recast/PartitionType.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/DotRecast.Recast/PartitionType.cs b/src/DotRecast.Recast/PartitionType.cs index 9874a84..1ebabb6 100644 --- a/src/DotRecast.Recast/PartitionType.cs +++ b/src/DotRecast.Recast/PartitionType.cs @@ -1,4 +1,5 @@ using System.Collections.Immutable; +using System.Linq; namespace DotRecast.Recast { @@ -21,6 +22,11 @@ namespace DotRecast.Recast Name = name; } + public static PartitionType OfIdx(int idx) + { + return Values.FirstOrDefault(x => x.Idx == idx) ?? WATERSHED; + } + public override string ToString() => Name; } } \ No newline at end of file