2007-12-29 15:50:16 +00:00
|
|
|
using System;
|
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Globalization;
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
namespace CodeImp.DoomBuilder.Config
|
|
|
|
{
|
2008-02-21 06:47:43 +00:00
|
|
|
public class GeneralizedBit : INumberedTitle, IComparable<GeneralizedBit>
|
2007-12-29 15:50:16 +00:00
|
|
|
{
|
|
|
|
#region ================== Constants
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region ================== Variables
|
|
|
|
|
|
|
|
// Properties
|
|
|
|
private int index;
|
|
|
|
private string title;
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region ================== Properties
|
|
|
|
|
|
|
|
public int Index { get { return index; } }
|
|
|
|
public string Title { get { return title; } }
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region ================== Constructor / Disposer
|
|
|
|
|
|
|
|
// Constructor
|
2008-02-21 06:47:43 +00:00
|
|
|
internal GeneralizedBit(int index, string title)
|
2007-12-29 15:50:16 +00:00
|
|
|
{
|
|
|
|
// Initialize
|
|
|
|
this.index = index;
|
|
|
|
this.title = title;
|
|
|
|
|
|
|
|
// We have no destructor
|
|
|
|
GC.SuppressFinalize(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region ================== Methods
|
|
|
|
|
|
|
|
// This presents the item as string
|
|
|
|
public override string ToString()
|
|
|
|
{
|
|
|
|
return title;
|
|
|
|
}
|
|
|
|
|
|
|
|
// This compares against another
|
2008-02-21 06:47:43 +00:00
|
|
|
public int CompareTo(GeneralizedBit other)
|
2007-12-29 15:50:16 +00:00
|
|
|
{
|
|
|
|
if(this.index < other.index) return -1;
|
|
|
|
else if(this.index > other.index) return 1;
|
|
|
|
else return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
}
|
|
|
|
}
|