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