summaryrefslogtreecommitdiff
path: root/src/resources/item/item.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-04-21 04:44:53 +0300
committerAndrei Karas <akaras@inbox.ru>2017-04-21 20:37:02 +0300
commit862e8f821789014b6167f37976b80694d6d310e3 (patch)
tree7c4d77a370f4da3d84a649b0d10e4d0a05725e6a /src/resources/item/item.cpp
parent62fa051ace7097e78134d46505070a70c08e128f (diff)
downloadplus-862e8f821789014b6167f37976b80694d6d310e3.tar.gz
plus-862e8f821789014b6167f37976b80694d6d310e3.tar.bz2
plus-862e8f821789014b6167f37976b80694d6d310e3.tar.xz
plus-862e8f821789014b6167f37976b80694d6d310e3.zip
Add item options into item and get it from server.
Diffstat (limited to 'src/resources/item/item.cpp')
-rw-r--r--src/resources/item/item.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/resources/item/item.cpp b/src/resources/item/item.cpp
index d738ca0e3..bc6614e52 100644
--- a/src/resources/item/item.cpp
+++ b/src/resources/item/item.cpp
@@ -30,10 +30,14 @@
#include "resources/iteminfo.h"
+#include "resources/item/itemoptionslist.h"
+
#include "resources/loaders/imageloader.h"
#include "net/serverfeatures.h"
+#include "utils/delete2.h"
+
#include "debug.h"
DragDrop dragDrop(nullptr, DragDropSource::Empty);
@@ -56,6 +60,7 @@ Item::Item(const int id,
mDescription(),
mTags(),
mCards(),
+ mOptions(nullptr),
mRefine(refine),
mInvIndex(0),
mType(type),
@@ -78,6 +83,7 @@ Item::~Item()
mImage->decRef();
mImage = nullptr;
}
+ delete2(mOptions);
dragDrop.clearItem(this);
}
@@ -176,6 +182,11 @@ void Item::addCard(const int card)
}
}
+void Item::setOptions(const ItemOptionsList *const options)
+{
+ mOptions = ItemOptionsList::copy(options);
+}
+
void Item::updateColor()
{
if (serverFeatures && serverFeatures->haveItemColors())