UltimateZoneBuilder/Source/Config/LinedefActionCategory.cs

118 lines
2.5 KiB
C#
Raw Normal View History

2007-12-26 00:31:32 +00:00
#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.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using CodeImp.DoomBuilder.IO;
using CodeImp.DoomBuilder.Data;
using System.IO;
using System.Diagnostics;
using System.Windows.Forms;
using CodeImp.DoomBuilder.Rendering;
#endregion
namespace CodeImp.DoomBuilder.Config
{
2008-01-02 21:49:43 +00:00
public class LinedefActionCategory : IComparable<LinedefActionCategory>
2007-12-26 00:31:32 +00:00
{
#region ================== Constants
#endregion
#region ================== Variables
// Category properties
private string name;
private string title;
2007-12-26 00:31:32 +00:00
// Actions
private List<LinedefActionInfo> actions;
// Disposing
private bool isdisposed = false;
#endregion
#region ================== Properties
public string Name { get { return name; } }
public string Title { get { return title; } }
2007-12-26 00:31:32 +00:00
public List<LinedefActionInfo> Actions { get { return actions; } }
public bool IsDisposed { get { return isdisposed; } }
#endregion
#region ================== Constructor / Disposer
// Constructor
internal LinedefActionCategory(string name, string title)
2007-12-26 00:31:32 +00:00
{
// Initialize
this.name = name;
this.title = title;
2007-12-26 00:31:32 +00:00
this.actions = new List<LinedefActionInfo>();
// We have no destructor
GC.SuppressFinalize(this);
}
2008-01-02 21:49:43 +00:00
// Disposer
internal void Dispose()
2007-12-26 00:31:32 +00:00
{
// Not already disposed?
if(!isdisposed)
{
// Clean up
actions = null;
// Done
isdisposed = true;
}
}
#endregion
#region ================== Methods
// This adds an action to this category
2008-01-02 21:49:43 +00:00
internal void Add(LinedefActionInfo a)
2007-12-26 00:31:32 +00:00
{
// Make it so.
actions.Add(a);
}
// This compares against another action category
public int CompareTo(LinedefActionCategory other)
{
return string.Compare(this.name, other.name);
}
// String representation
public override string ToString()
{
return title;
}
2007-12-26 00:31:32 +00:00
#endregion
}
}