UltimateZoneBuilder/Source/Map/Linedef.cs

100 lines
1.8 KiB
C#
Raw Normal View History

2007-06-13 19:39:38 +00:00
/*
* 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.
*
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
namespace CodeImp.DoomBuilder.Map
{
internal class Linedef : IDisposable
{
#region ================== Constants
#endregion
#region ================== Variables
// Vertices
private Vertex start;
private Vertex end;
// Sidedefs
private Sidedef front;
private Sidedef back;
// Properties
private int flags;
private int action;
private int tag;
private byte[] args;
// Disposing
private bool isdisposed = false;
#endregion
#region ================== Properties
// Disposing
public bool IsDisposed { get { return isdisposed; } }
#endregion
#region ================== Constructor / Disposer
// Constructor
public Linedef(Vertex start, Vertex end)
{
// Initialize
this.start = start;
this.end = end;
// We have no destructor
GC.SuppressFinalize(this);
}
// Diposer
public void Dispose()
{
// Not already disposed?
if(!isdisposed)
{
// Detach from vertices
start.Detach(this);
end.Detach(this);
// Dispose sidedefs
front.Dispose();
back.Dispose();
// Clean up
start = null;
end = null;
front = null;
back = null;
// Done
isdisposed = true;
}
}
#endregion
#region ================== Methods
#endregion
}
}