Skip to content

Commit

Permalink
Added NamedTag equals function
Browse files Browse the repository at this point in the history
  • Loading branch information
gentlegiantJGC committed Aug 15, 2024
1 parent 1709c2a commit 8fcf6e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/amulet_nbt/cpp/tag/eq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <amulet_nbt/tag/list_methods.hpp>
#include <amulet_nbt/tag/compound.hpp>
#include <amulet_nbt/tag/array.hpp>
#include <amulet_nbt/tag/named_tag.hpp>
#include <amulet_nbt/tag/eq.hpp>


Expand Down Expand Up @@ -92,4 +93,7 @@ namespace AmuletNBT{
}
}, a);
};
bool NBTTag_eq(const AmuletNBT::NamedTag& a, const AmuletNBT::NamedTag& b) {
return a.name == b.name && NBTTag_eq(a.tag_node, b.tag_node);
};
}
2 changes: 2 additions & 0 deletions src/amulet_nbt/include/amulet_nbt/tag/eq.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <amulet_nbt/tag/list.hpp>
#include <amulet_nbt/tag/compound.hpp>
#include <amulet_nbt/tag/array.hpp>
#include <amulet_nbt/tag/named_tag.hpp>

namespace AmuletNBT {
bool NBTTag_eq(const AmuletNBT::ByteTag& a, const AmuletNBT::ByteTag& b);
Expand All @@ -23,4 +24,5 @@ namespace AmuletNBT {
bool NBTTag_eq(const AmuletNBT::IntArrayTag& a, const AmuletNBT::IntArrayTag& b);
bool NBTTag_eq(const AmuletNBT::LongArrayTag& a, const AmuletNBT::LongArrayTag& b);
bool NBTTag_eq(const AmuletNBT::TagNode& a, const AmuletNBT::TagNode& b);
bool NBTTag_eq(const AmuletNBT::NamedTag& a, const AmuletNBT::NamedTag& b);
}

0 comments on commit 8fcf6e4

Please sign in to comment.