throwBuilderPlug.Me.ScriptRunner.CreateRuntimeException("Linedef is disposed, the index property can not be accessed.");
returnlinedef.Index;
}
}
/// <summary>
/// The linedef's start `Vertex`.
/// </summary>
publicVertexWrapperstart
{
get
{
if(linedef.IsDisposed)
throwBuilderPlug.Me.ScriptRunner.CreateRuntimeException("Linedef is disposed, the start property can not be accessed.");
returnnewVertexWrapper(linedef.Start);
}
}
/// <summary>
/// The linedef's end `Vertex`.
/// </summary>
publicVertexWrapperend
{
get
{
if(linedef.IsDisposed)
throwBuilderPlug.Me.ScriptRunner.CreateRuntimeException("Linedef is disposed, the end property can not be accessed.");
returnnewVertexWrapper(linedef.End);
}
}
/// <summary>
/// The `Linedef`'s front `Sidedef`. Is `null` when there is no front (should not happen).
/// </summary>
publicSidedefWrapperfront
{
get
{
if(linedef.IsDisposed)
throwBuilderPlug.Me.ScriptRunner.CreateRuntimeException("Linedef is disposed, the front property can not be accessed.");
if(linedef.Front==null)
returnnull;
returnnewSidedefWrapper(linedef.Front);
}
}
/// <summary>
/// The `Linedef`'s back `Sidedef`. Is `null` when there is no back.
/// </summary>
publicSidedefWrapperback
{
get
{
if(linedef.IsDisposed)
throwBuilderPlug.Me.ScriptRunner.CreateRuntimeException("Linedef is disposed, the back property can not be accessed.");
if(linedef.Back==null)
returnnull;
returnnewSidedefWrapper(linedef.Back);
}
}
/// <summary>
/// The `Line2D` from the `start` to the `end` `Vertex`.
/// </summary>
publicLine2DWrapperline
{
get
{
if(linedef.IsDisposed)
throwBuilderPlug.Me.ScriptRunner.CreateRuntimeException("Linedef is disposed, the line property can not be accessed.");
returnnewLine2DWrapper(linedef.Line);
}
}
/// <summary>
/// If the `Linedef` is selected or not.
/// </summary>
publicboolselected
{
get
{
if(linedef.IsDisposed)
throwBuilderPlug.Me.ScriptRunner.CreateRuntimeException("Linedef is disposed, the selected property can not be accessed.");
returnlinedef.Selected;
}
set
{
if(linedef.IsDisposed)
throwBuilderPlug.Me.ScriptRunner.CreateRuntimeException("Linedef is disposed, the selected property can not be accessed.");
linedef.Selected=value;
}
}
/// <summary>
/// If the `Linedef` is marked or not. It is used to mark map elements that were created or changed (for example after drawing new geometry).
/// </summary>
publicboolmarked
{
get
{
if(linedef.IsDisposed)
throwBuilderPlug.Me.ScriptRunner.CreateRuntimeException("Linedef is disposed, the marked property can not be accessed.");
returnlinedef.Marked;
}
set
{
if(linedef.IsDisposed)
throwBuilderPlug.Me.ScriptRunner.CreateRuntimeException("Linedef is disposed, the marked property can not be accessed.");
linedef.Marked=value;
}
}
/// <summary>
/// The activation flag. Hexen format only.
/// </summary>
publicintactivate
{
get
{
if(linedef.IsDisposed)
throwBuilderPlug.Me.ScriptRunner.CreateRuntimeException("Linedef is disposed, the activate property can not be accessed.");
returnlinedef.Activate;
}
set
{
if(linedef.IsDisposed)
throwBuilderPlug.Me.ScriptRunner.CreateRuntimeException("Linedef is disposed, the activate property can not be accessed.");
linedef.Activate=value;
}
}
/// <summary>
/// `Linedef` flags. It's an object with the flags as properties. In Doom format and Hexen format they are identified by numbers, in UDMF by their name.
/// Doom and Hexen:
/// ```
/// ld.flags['64'] = true; // Set the block sound flag
/// ```
/// UDMF:
/// ```
/// ld.flags['blocksound'] = true; // Set the block sound flag
/// ld.flags.blocksound = true; // Also works
/// ```
/// </summary>
publicExpandoObjectflags
{
get
{
if(linedef.IsDisposed)
throwBuilderPlug.Me.ScriptRunner.CreateRuntimeException("Linedef is disposed, the flags property can not be accessed.");
/// Gets the shortest "safe" squared distance from `pos` to the line. If `bounded` is `true` that means that the not the whole line's length will be used, but `lengthInv` less at the start and end.
/// </summary>
/// <param name="pos">Point to check against</param>
/// <param name="bounded">`true` if only the finite length of the line should be used, `false` if the infinite length of the line should be used</param>
/// <returns>Squared distance to the line</returns>
/// Gets the shortest "safe" distance from `pos` to the line. If `bounded` is `true` that means that the not the whole line's length will be used, but `lengthInv` less at the start and end.
/// </summary>
/// <param name="pos">Point to check against</param>
/// <param name="bounded">`true` if only the finite length of the line should be used, `false` if the infinite length of the line should be used</param>
/// <returns>Distance to the line</returns>
publicdoublesafeDistanceTo(objectpos,boolbounded)
{
if(linedef.IsDisposed)
throwBuilderPlug.Me.ScriptRunner.CreateRuntimeException("Linedef is disposed, the safeDistanceTo method can not be accessed.");
/// Gets the shortest squared distance from `pos` to the line.
/// </summary>
/// <param name="pos">Point to check against</param>
/// <param name="bounded">`true` if only the finite length of the line should be used, `false` if the infinite length of the line should be used</param>
/// <returns>Squared distance to the line</returns>
publicdoubledistanceToSq(objectpos,boolbounded)
{
if(linedef.IsDisposed)
throwBuilderPlug.Me.ScriptRunner.CreateRuntimeException("Linedef is disposed, the distanceToSq method can not be accessed.");
/// Gets the shortest distance from `pos` to the line.
/// </summary>
/// <param name="pos">Point to check against</param>
/// <param name="bounded">`true` if only the finite length of the line should be used, `false` if the infinite length of the line should be used</param>
/// <returns>Distance to the line</returns>
publicdoubledistanceTo(objectpos,boolbounded)
{
if(linedef.IsDisposed)
throwBuilderPlug.Me.ScriptRunner.CreateRuntimeException("Linedef is disposed, the distanceTo method can not be accessed.");
/// Splits the `Linedef` at the given position. This can either be a `Vector2D`, an array of numbers, or an existing `Vertex`. The result will be two lines, from the start `Vertex` of the `Linedef` to `pos`, and from `pos` to the end `Vertex` of the `Linedef`.
/// </summary>
/// <param name="pos">`Vertex` to split by</param>
/// <returns>The newly created `Linedef`</returns>
publicLinedefWrappersplit(objectpos)
{
if(linedef.IsDisposed)
throwBuilderPlug.Me.ScriptRunner.CreateRuntimeException("Linedef is disposed, the split method can not be accessed.");