diff options
author | madmaxoft <github@xoft.cz> | 2014-04-20 14:16:26 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-04-21 10:31:30 +0200 |
commit | 7c6ef26be95c90ea6686840f1580953b2b8029a1 (patch) | |
tree | 4698f436b8c38ccbf5d70f960729ed0bdcbba66e /src/Enchantments.cpp | |
parent | Replaced X.size() with X.empty(), where applicable. (diff) | |
download | cuberite-7c6ef26be95c90ea6686840f1580953b2b8029a1.tar cuberite-7c6ef26be95c90ea6686840f1580953b2b8029a1.tar.gz cuberite-7c6ef26be95c90ea6686840f1580953b2b8029a1.tar.bz2 cuberite-7c6ef26be95c90ea6686840f1580953b2b8029a1.tar.lz cuberite-7c6ef26be95c90ea6686840f1580953b2b8029a1.tar.xz cuberite-7c6ef26be95c90ea6686840f1580953b2b8029a1.tar.zst cuberite-7c6ef26be95c90ea6686840f1580953b2b8029a1.zip |
Diffstat (limited to 'src/Enchantments.cpp')
-rw-r--r-- | src/Enchantments.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Enchantments.cpp b/src/Enchantments.cpp index dad92dc91..64f89815b 100644 --- a/src/Enchantments.cpp +++ b/src/Enchantments.cpp @@ -29,6 +29,18 @@ cEnchantments::cEnchantments(const AString & a_StringSpec) +void cEnchantments::Add(const cEnchantments & a_Other) +{ + for (cEnchantments::cMap::const_iterator itr = a_Other.m_Enchantments.begin(), end = a_Other.m_Enchantments.end(); itr != end; ++itr) + { + SetLevel(itr->first, itr->second); + } // for itr - a_Other.m_Enchantments[] +} + + + + + void cEnchantments::AddFromString(const AString & a_StringSpec) { // Add enchantments in the stringspec; if a specified enchantment already exists, overwrites it |