2015-03-25 02:02:36 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace ScriptToolGui
|
|
|
|
|
{
|
2015-03-25 15:55:09 +00:00
|
|
|
|
class IndexMapping : IEnumerable<IndexPair>, ICollection<IndexPair>
|
2015-03-25 02:02:36 +00:00
|
|
|
|
{
|
2015-03-25 15:55:09 +00:00
|
|
|
|
public ICollection<IndexPair> Pairs { get; private set; }
|
2015-03-25 02:02:36 +00:00
|
|
|
|
|
|
|
|
|
public IndexMapping()
|
|
|
|
|
{
|
|
|
|
|
Pairs = new List<IndexPair>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Add(int first, int second)
|
|
|
|
|
{
|
|
|
|
|
Pairs.Add(new IndexPair(first, second));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IEnumerator<IndexPair> GetEnumerator()
|
|
|
|
|
{
|
|
|
|
|
return Pairs.GetEnumerator();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
|
|
|
|
|
{
|
|
|
|
|
return GetEnumerator();
|
|
|
|
|
}
|
2015-03-25 15:55:09 +00:00
|
|
|
|
|
|
|
|
|
public void Add(IndexPair item)
|
|
|
|
|
{
|
|
|
|
|
Pairs.Add(item);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Clear()
|
|
|
|
|
{
|
|
|
|
|
Pairs.Clear();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool Contains(IndexPair item)
|
|
|
|
|
{
|
|
|
|
|
return Pairs.Contains(item);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void CopyTo(IndexPair[] array, int arrayIndex)
|
|
|
|
|
{
|
|
|
|
|
Pairs.CopyTo(array, arrayIndex);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int Count
|
|
|
|
|
{
|
|
|
|
|
get { return Pairs.Count; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool IsReadOnly
|
|
|
|
|
{
|
|
|
|
|
get { return Pairs.IsReadOnly; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool Remove(IndexPair item)
|
|
|
|
|
{
|
|
|
|
|
return Pairs.Remove(item);
|
|
|
|
|
}
|
2015-03-25 02:02:36 +00:00
|
|
|
|
}
|
|
|
|
|
}
|