2021년 4학년 1학기 기업연계프로젝트2
컴퓨터소프트웨어공학과 <원광투어팀>
팀장 : 송유진
팀원 : 김나영, 이경희, 한유진
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
//========= Copyright 2016-2020, HTC Corporation. All rights reserved. ===========
namespace HTC.UnityPlugin.Utility{ public class OrderedIndexedSet<T> : IndexedSet<T> { public OrderedIndexedSet() : base() { }
public OrderedIndexedSet(int capacity) : base(capacity) { }
public override void Insert(int index, T item) { m_Dictionary.Add(item, index); m_List.Insert(index, item);
for (int i = index + 1, imax = m_List.Count; i < imax; ++i) { m_Dictionary[m_List[i]] = i; } }
public override void RemoveAt(int index) { m_Dictionary.Remove(m_List[index]); m_List.RemoveAt(index);
for (int i = index, imax = m_List.Count; i < imax; ++i) { m_Dictionary[m_List[i]] = i; } }
public T GetFirst() { return m_List[0]; }
public bool TryGetFirst(out T item) { if (m_List.Count == 0) { item = default(T); return false; } else { item = GetFirst(); return true; } }
public T GetLast() { return m_List[m_List.Count - 1]; }
public bool TryGetLast(out T item) { if (m_List.Count == 0) { item = default(T); return false; } else { item = GetLast(); return true; } } }}
|