2015-03-25 02:02:27 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace ScriptToolGui
|
|
|
|
|
{
|
|
|
|
|
class MatchedGroupCollection : IEnumerable<MatchedGroup>
|
|
|
|
|
{
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
public List<MatchedGroup> Groups { get; private set; }
|
2015-03-27 14:13:01 +00:00
|
|
|
|
public List<Game> Games { get; private set; }
|
2015-03-25 02:02:27 +00:00
|
|
|
|
|
2015-03-27 14:13:01 +00:00
|
|
|
|
public MatchedGroupCollection(string name, params Game[] games)
|
2015-03-25 02:02:27 +00:00
|
|
|
|
{
|
|
|
|
|
Name = name;
|
|
|
|
|
Groups = new List<MatchedGroup>();
|
2015-03-27 14:13:01 +00:00
|
|
|
|
Games = new List<Game>(games);
|
2015-03-25 02:02:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
2015-03-25 16:20:19 +00:00
|
|
|
|
public void SortGroups()
|
|
|
|
|
{
|
|
|
|
|
Groups.Sort((g1, g2) => g1.Refs[Game.Eb].Index.CompareTo(g2.Refs[Game.Eb].Index));
|
|
|
|
|
}
|
|
|
|
|
|
2015-03-25 02:02:27 +00:00
|
|
|
|
public IEnumerator<MatchedGroup> GetEnumerator()
|
|
|
|
|
{
|
|
|
|
|
return Groups.GetEnumerator();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
|
|
|
|
|
{
|
|
|
|
|
return GetEnumerator();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
|
|
|
|
return Name;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|