1using System.Collections.Generic;
9 public List<ModItem<T>>
list =
new List<ModItem<T>>();
11 public Dictionary<string, ModItem<T>>
dict =
new Dictionary<string, ModItem<T>>();
31 while (category !=
null && !(modItem.
category == category));
35 public string GetNextID(
string currentId,
int a,
bool ignoreCategory =
true)
37 int num =
IndexOf(currentId) + a;
38 if (num >=
list.Count)
51 for (
int i = 0; i <
list.Count; i++)
64 if (
dict.TryGetValue(
id, out value))
80 return item.GetObject();
85 public void Add(FileInfo fi,
string path =
null,
string prefix =
"")
87 Add(Path.GetFileNameWithoutExtension(prefix + ((fi !=
null) ? fi.Name : path)), fi, path);
90 public void Add(
string id, FileInfo fi,
string path =
null)
92 if (
dict.ContainsKey(
id))
94 dict[id].Set(fi, path);
ModItemList(int _catLength=0)
List< ModItem< T > > list
void Add(FileInfo fi, string path=null, string prefix="")
T GetObject(string id, object option=null)
string GetNextID(string currentId, int a, bool ignoreCategory=true)
Dictionary< string, ModItem< T > > dict
void Add(string id, FileInfo fi, string path=null)
string GetRandomID(string category=null)
ModItem< T > GetItem(string id, bool returnNull=false)