-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from Carnagion/development
Merge v2.0.0 into stable
- Loading branch information
Showing
28 changed files
with
1,026 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using System.Xml; | ||
|
||
using JetBrains.Annotations; | ||
|
||
using Godot.Serialization; | ||
|
||
namespace Godot.Modding.Patching | ||
{ | ||
/// <summary> | ||
/// An <see cref="IPatch"/> that removes an attribute from an <see cref="XmlElement"/>. | ||
/// </summary> | ||
[PublicAPI] | ||
public class AttributeRemovePatch : IPatch | ||
{ | ||
/// <summary> | ||
/// Initialises a new <see cref="AttributeRemovePatch"/> with the specified parameters. | ||
/// </summary> | ||
/// <param name="attribute">The name of the attribute to remove.</param> | ||
public AttributeRemovePatch(string attribute) | ||
{ | ||
this.Attribute = attribute; | ||
} | ||
|
||
[UsedImplicitly] | ||
private AttributeRemovePatch() | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// The name of the attribute to remove. | ||
/// </summary> | ||
[Serialize] | ||
public string Attribute | ||
{ | ||
get; | ||
[UsedImplicitly] | ||
private set; | ||
} = null!; | ||
|
||
/// <summary> | ||
/// Removes <see cref="Attribute"/> from <paramref name="data"/> if <paramref name="data"/> is an <see cref="XmlElement"/>. | ||
/// </summary> | ||
/// <param name="data">The <see cref="XmlNode"/> to apply the patch on.</param> | ||
public void Apply(XmlNode data) | ||
{ | ||
if (data is XmlElement element) | ||
{ | ||
element.RemoveAttribute(this.Attribute); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.