private void AddData(Data data, Type dataType, int priority) { if (data == null) { throw new GameFrameworkException("Can not add null data"); } DataInfo dataInfo = DataInfo.Create(data); dataInfo.Priority = priority; m_dicDataInfos.Add(dataType, dataInfo); LinkedListNode <DataInfo> current = m_linkedListDataInfos.First; while (current != null) { if (dataInfo.Priority > current.Value.Priority) { break; } current = current.Next; } if (current != null) { m_linkedListDataInfos.AddBefore(current, dataInfo); } else { m_linkedListDataInfos.AddLast(dataInfo); } }
public void Add(string description, Func <T, object> function) { list.Add(DataInfo.Create <T>(description, function)); }