Skip to content

Commit

Permalink
Add implicit cast without key
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchLeaders committed Jan 20, 2025
1 parent c1808e6 commit 5ffadff
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/BymlLibrary/Nodes/Containers/BymlArrayChangelogEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@ public readonly struct BymlArrayChangelogEntry

public Byml? KeySecondary { get; init; }

public static implicit operator BymlArrayChangelogEntry((int index, BymlChangeType change, Byml node, Byml? keyPrimary, Byml? keySecondary) x) => new() {
Index = x.index,
Change = x.change,
Node = x.node,
KeyPrimary = x.keyPrimary,
KeySecondary = x.keySecondary,
public static implicit operator BymlArrayChangelogEntry((int index, BymlChangeType change, Byml node, Byml? keyPrimary, Byml? keySecondary) src) => new() {
Index = src.index,
Change = src.change,
Node = src.node,
KeyPrimary = src.keyPrimary,
KeySecondary = src.keySecondary,
};

public static implicit operator BymlArrayChangelogEntry((int index, BymlChangeType change, Byml node) src) => new() {
Index = src.index,
Change = src.change,
Node = src.node
};

public void Deconstruct(out int index, out BymlChangeType change, out Byml node, out Byml? keyPrimary, out Byml? keySecondary)
Expand Down

0 comments on commit 5ffadff

Please sign in to comment.