aurora/aurora-shared/Cursor/CursorList.cs
2021-04-12 20:58:44 -04:00

32 lines
626 B
C#

using System.Collections.Generic;
using System.Collections;
using System;
using System.Linq;
using Aurora.Utils;
namespace Aurora.Cursor
{
public class CursorList<T> : SortedList<string, T> where T : ICursorObject
{
public CursorList()
{
}
public CursorList<T> Add(T item)
{
string id = item.Id;
if (item.Id == null)
{
id = HashUtil.GetHash(new string[] { item.GetHashCode().ToString() }).ToString();
item.Id = id;
}
this.Add(id, item);
return this;
}
}
}