Files
sbox-public/engine/Sandbox.Tools/MapEditor/HammerSceneEditorSession.Undo.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

70 lines
1.6 KiB
C#

using System;
namespace Editor.MapEditor;
public partial class HammerSceneEditorSession
{
public ISceneUndoScope UndoScope( string name )
{
return new HammerSceneUndoScope( this, name );
}
}
// Sol: we should handle these properly but just stubbing this out for now
// instead of throwing a NotImplementedException which was obviously breaking things
internal class HammerSceneUndoScope : ISceneUndoScope
{
internal HammerSceneEditorSession Session { get; }
public HammerSceneUndoScope( HammerSceneEditorSession session, string name )
{
Session = session;
}
public IDisposable Push()
{
return default;
}
public ISceneUndoScope WithGameObjectCreations()
{
return this;
}
public ISceneUndoScope WithGameObjectDestructions( IEnumerable<GameObject> gameObjects )
{
return this;
}
public ISceneUndoScope WithGameObjectDestructions( GameObject gameObject )
{
return this;
}
public ISceneUndoScope WithGameObjectChanges( IEnumerable<GameObject> objects, GameObjectUndoFlags flags )
{
return this;
}
public ISceneUndoScope WithGameObjectChanges( GameObject gameObject, GameObjectUndoFlags flags )
{
return this;
}
public ISceneUndoScope WithComponentCreations()
{
return this;
}
public ISceneUndoScope WithComponentDestructions( IEnumerable<Component> components )
{
return this;
}
public ISceneUndoScope WithComponentDestructions( Component component )
{
return this;
}
public ISceneUndoScope WithComponentChanges( IEnumerable<Component> components )
{
return this;
}
public ISceneUndoScope WithComponentChanges( Component component )
{
return this;
}
}