Files
sbox-public/engine/Sandbox.Tools/MapEditor/MapDoc/Nodes/MapPath.cs
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

43 lines
893 B
C#

using NativeMapDoc;
using System.ComponentModel.DataAnnotations;
namespace Editor.MapDoc;
/// <summary>
/// Path containing a bunch of <see cref="MapPathNode"/>
/// </summary>
[Display( Name = "Path" ), Icon( "conversion_path" )]
public sealed class MapPath : MapNode
{
internal CMapPath pathNative;
internal MapPath( HandleCreationData _ ) { }
public MapPath( MapDocument mapDocument = null )
{
ThreadSafe.AssertIsMainThread();
// Default to the active map document if none specificed
mapDocument ??= MapEditor.Hammer.ActiveMap;
Assert.IsValid( mapDocument );
using var h = IHandle.MakeNextHandle( this );
mapDocument.native.CreateMapPath();
}
internal override void OnNativeInit( CMapNode ptr )
{
base.OnNativeInit( ptr );
pathNative = (CMapPath)ptr;
}
internal override void OnNativeDestroy()
{
base.OnNativeDestroy();
pathNative = default;
}
}