UltimateZoneBuilder/Source/Config/LinedefActionCategory.cs

109 lines
2.3 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;
// Actions
private List<LinedefActionInfo> actions;
// Disposing
private bool isdisposed = false;
#endregion
#region ================== Properties
public string Name { get { return name; } }
public List<LinedefActionInfo> Actions { get { return actions; } }
public bool IsDisposed { get { return isdisposed; } }
#endregion
#region ================== Constructor / Disposer
// Constructor
2008-01-02 21:49:43 +00:00
internal LinedefActionCategory(string name)
2007-12-26 00:31:32 +00:00
{
// Initialize
this.name = name;
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);
}
#endregion
}
}