2014-07-16 09:45:04 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
namespace CodeImp.DoomBuilder.Map
|
2013-04-01 11:06:01 +00:00
|
|
|
|
{
|
|
|
|
|
public class GroupInfo
|
|
|
|
|
{
|
2014-07-16 09:45:04 +00:00
|
|
|
|
private readonly int numSectors;
|
|
|
|
|
private readonly int numLines;
|
|
|
|
|
private readonly int numVerts;
|
|
|
|
|
private readonly int numThings;
|
|
|
|
|
|
|
|
|
|
private readonly int index;
|
|
|
|
|
private readonly bool empty;
|
|
|
|
|
|
|
|
|
|
public bool Empty { get { return empty; } }
|
|
|
|
|
public int Index { get { return index; } }
|
|
|
|
|
|
2014-12-03 23:15:26 +00:00
|
|
|
|
public GroupInfo(int index, int numSectors, int numLines, int numVerts, int numThings)
|
|
|
|
|
{
|
2014-07-16 09:45:04 +00:00
|
|
|
|
this.index = index;
|
2013-04-01 11:06:01 +00:00
|
|
|
|
this.numSectors = numSectors;
|
|
|
|
|
this.numLines = numLines;
|
|
|
|
|
this.numVerts = numVerts;
|
|
|
|
|
this.numThings = numThings;
|
2014-07-16 09:45:04 +00:00
|
|
|
|
|
|
|
|
|
empty = (numSectors == 0 && numLines == 0 && numVerts == 0 && numThings == 0);
|
2013-04-01 11:06:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-12-03 23:15:26 +00:00
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
2014-07-16 09:45:04 +00:00
|
|
|
|
if (empty) return index + ": Empty";
|
|
|
|
|
List<string> result = new List<string>();
|
|
|
|
|
|
|
|
|
|
if(numSectors > 0) result.Add(numSectors + (numSectors > 1 ? " sectors" : " sector"));
|
|
|
|
|
if(numLines > 0) result.Add(numLines + (numLines > 1 ? " lines" : " line"));
|
|
|
|
|
if(numVerts > 0) result.Add(numVerts + (numVerts > 1 ? " vertices" : " vertex"));
|
|
|
|
|
if(numThings > 0) result.Add(numThings + (numThings > 1 ? " things" : " thing"));
|
2013-04-01 11:06:01 +00:00
|
|
|
|
|
2014-07-16 09:45:04 +00:00
|
|
|
|
return index + ": " + string.Join(", ", result.ToArray());
|
2013-04-01 11:06:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|