NBTExplorer/NBTUtil/Ops/DeleteOperation.cs

26 lines
610 B
C#
Raw Normal View History

2020-06-28 03:21:06 +00:00
using System;
using System.Collections.Generic;
using System.IO;
using NBTExplorer.Model;
namespace NBTUtil.Ops
{
class DeleteOperation : ConsoleOperation
{
public override bool OptionsValid (ConsoleOptions options)
{
return true;
}
public override bool CanProcess (DataNode dataNode)
{
return (dataNode != null) && dataNode.CanDeleteNode && (dataNode.Root != dataNode);
}
public override bool Process (DataNode dataNode, ConsoleOptions options)
{
return dataNode.DeleteNode();
}
}
}