diff options
Diffstat (limited to 'Assets/ThirdParty/VRM/VRM/UniJSON/Scripts/ListTreeNode/ListTreeNodeArrayExtensions.cs')
-rw-r--r-- | Assets/ThirdParty/VRM/VRM/UniJSON/Scripts/ListTreeNode/ListTreeNodeArrayExtensions.cs | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/Assets/ThirdParty/VRM/VRM/UniJSON/Scripts/ListTreeNode/ListTreeNodeArrayExtensions.cs b/Assets/ThirdParty/VRM/VRM/UniJSON/Scripts/ListTreeNode/ListTreeNodeArrayExtensions.cs deleted file mode 100644 index 7a68d2ac..00000000 --- a/Assets/ThirdParty/VRM/VRM/UniJSON/Scripts/ListTreeNode/ListTreeNodeArrayExtensions.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - - -namespace UniJSON -{ - public static class ListTreeNodeArrayExtensions - { - public static IEnumerable<ListTreeNode<T>> ArrayItems<T>(this ListTreeNode<T> self) where T : IListTreeItem, IValue<T> - { - if (!self.IsArray()) throw new DeserializationException("is not array"); - return self.Children; - } - - [Obsolete("Use GetArrayItem(index)")] - public static ListTreeNode<T> GetArrrayItem<T>(this ListTreeNode<T> self, int index) - where T : IListTreeItem, IValue<T> - { - return GetArrayItem(self, index); - } - - public static ListTreeNode<T> GetArrayItem<T>(this ListTreeNode<T> self, int index) - where T : IListTreeItem, IValue<T> - { - int i = 0; - foreach (var v in self.ArrayItems()) - { - if (i++ == index) - { - return v; - } - } - throw new KeyNotFoundException(); - } - - public static int GetArrayCount<T>(this ListTreeNode<T> self) - where T : IListTreeItem, IValue<T> - { - if (!self.IsArray()) throw new DeserializationException("is not array"); - return self.Children.Count(); - } - - public static int IndexOf<T>(this ListTreeNode<T> self, ListTreeNode<T> child) - where T : IListTreeItem, IValue<T> - { - int i = 0; - foreach (var v in self.ArrayItems()) - { - if (v.ValueIndex == child.ValueIndex) - { - return i; - } - ++i; - } - throw new KeyNotFoundException(); - } - } -} |