mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-23 12:22:35 +00:00
76559ae881
MAPINFO: added "DoomEdNum" and "SpawnNums" blocks support. MAPINFO: added "#include" directive support. MAPINFO: added "$gzdb_skip" special comment support. DECORATE: "spawnthing" Game Configuration block is now updated using "SpawnID" actor property. Game configurations: added "class" property to the most of ZDoom things. Actions: removed "Reload MAPINFO" action. Documentation: merged "GLDEFS and MODELDEF support", "(Z)MAPINFO support" and "TEXTURES support" topics into "(G)ZDoom text lumps support", added info about the other text lumps GZDB can use.
85 lines
1.8 KiB
C#
85 lines
1.8 KiB
C#
|
|
#region ================== Copyright (c) 2007 Pascal vd Heiden
|
|
|
|
/*
|
|
* Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com
|
|
* This program is released under GNU General Public License
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
*/
|
|
|
|
#endregion
|
|
|
|
#region ================== Namespaces
|
|
|
|
using System;
|
|
using System.Globalization;
|
|
|
|
#endregion
|
|
|
|
namespace CodeImp.DoomBuilder.Config
|
|
{
|
|
public class EnumItem : IComparable<EnumItem>
|
|
{
|
|
#region ================== Constants
|
|
|
|
#endregion
|
|
|
|
#region ================== Variables
|
|
|
|
private readonly string value;
|
|
private readonly string title;
|
|
|
|
#endregion
|
|
|
|
#region ================== Properties
|
|
|
|
public string Value { get { return value; } }
|
|
public string Title { get { return title; } }
|
|
|
|
#endregion
|
|
|
|
#region ================== Constructor
|
|
|
|
// Constructor
|
|
public EnumItem(string value, string title)
|
|
{
|
|
// Initialize
|
|
this.value = value;
|
|
this.title = title;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ================== Methods
|
|
|
|
// String representation
|
|
public override string ToString()
|
|
{
|
|
return title;
|
|
}
|
|
|
|
//mxd. This compares against another activate info
|
|
public int CompareTo(EnumItem other)
|
|
{
|
|
int thisval = GetIntValue();
|
|
int otherval = other.GetIntValue();
|
|
if(thisval < otherval) return -1;
|
|
if(thisval > otherval) return 1;
|
|
return 0;
|
|
}
|
|
|
|
// This returns the value as int
|
|
public int GetIntValue()
|
|
{
|
|
int result;
|
|
return int.TryParse(value, NumberStyles.Integer, CultureInfo.InvariantCulture, out result) ? result : 0;
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|