Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
 public void Add(string description, Func <T, object> function)
 {
     list.Add(DataInfo.Create <T>(description, function));
 }