UltimateZoneBuilder/Source/Core/Config/EnumItem.cs
MaxED f9b5399a39 Added AngleByteHandler (type 22).
Bit Flags form now changes width to show flags with long names without scrolling.
Bit Flags form: flag numbers are now shown as well as names.
Game configurations: updated Hexen and ZDoom linedef definitions. Now they (hopefully) fully match ZDoom ones. 
Action Selector Control: fixed a crash when trying to increase action above maximum value using mouse wheel.
Sector/Linedef/Thing tag lists are now handled by corresponding TypeHandlers (and not by dirty hacks as before).
Linedef info panel: line peggedness labels were obscured by effect label in Doom/Hexen map formats.
2014-12-08 21:06:08 +00:00

74 lines
1.5 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.Globalization;
#endregion
namespace CodeImp.DoomBuilder.Config
{
public class 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;
}
// This returns the value as int
public int GetIntValue()
{
int result;
return int.TryParse(value, NumberStyles.Integer, CultureInfo.InvariantCulture, out result) ? result : 0;
}
#endregion
}
}