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 c60ea7b
Show file tree
Hide file tree
Showing 2 changed files with 5 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);
};
}
1 change: 1 addition & 0 deletions src/amulet_nbt/include/amulet_nbt/tag/eq.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,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 c60ea7b

Please sign in to comment.