UltimateZoneBuilder/Source/Core/Map/GroupInfo.cs
MaxED c6378809d5 Visual Mode: You can now Shift-Select (usually Select = LMB) to select all adjacent surfaces with same texture, Ctrl-Select to select all adjacent surfaces with same height.
Added Selection Groups options to Edit menu.
Selection Groups can now be cleared using either Edit -> Clear Group or Ctrl-Shift-[group number] shortcut.
Toolbar button groups can now be toggled using context menu. Hold "Shift" to toggle several button groups at once.
2013-04-01 11:06:01 +00:00

56 lines
1.5 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
namespace CodeImp.DoomBuilder.Map
{
public class GroupInfo
{
private int numSectors;
private int numLines;
private int numVerts;
private int numThings;
public GroupInfo(int numSectors, int numLines, int numVerts, int numThings) {
this.numSectors = numSectors;
this.numLines = numLines;
this.numVerts = numVerts;
this.numThings = numThings;
}
public override string ToString() {
string result = string.Empty;
if(numSectors > 0) result = numSectors + (numSectors > 1 ? " sectors" : " sector");
if(numLines > 0){
if(string.IsNullOrEmpty(result))
result = numLines + (numLines > 1 ? " lines" : " line");
else
result += ", " + numLines + (numLines > 1 ? " lines" : " line");
}
if(numVerts > 0){
if(string.IsNullOrEmpty(result))
result = numVerts + (numVerts > 1 ? " vertices" : " vertex");
else
result += ", " + numLines + (numVerts > 1 ? " vertices" : " vertex");
}
if(numThings > 0){
if(string.IsNullOrEmpty(result))
result = numThings + (numThings > 1 ? " things" : " thing");
else
result += ", " + numThings + (numThings > 1 ? " things" : " thing");
}
return result;
}
internal void Append(int numSectors, int numLines, int numVerts, int numThings) {
this.numSectors += numSectors;
this.numLines += numLines;
this.numVerts += numVerts;
this.numThings += numThings;
}
}
}