+
+bool potion::setData(char *datastr)
+{
+ try
+ {
+ char *temp;
+
+ mytype = ARMOR;
+
+ // Grab the item's id
+ temp = strtok(NULL, "~");
+ id = stringtoint(temp);
+
+ // Grab the item's name
+ temp = strtok(NULL, "~");
+ myname = temp;
+
+ // Grab the item's price
+ temp = strtok(NULL, "~");
+ myprice = stringtoint(temp);
+
+ // Grab the item's uses
+ temp = strtok(NULL, "~");
+ myuses = stringtoint(temp);
+
+ // Grab the item's modifiers
+ for (int x = 0; x < 5; x++)
+ {
+ temp = strtok(NULL, "~");
+ mymodifiers[x] = stringtoint(temp);
+ }
+ }
+ catch(char *str)
+ {
+ log("Exception setting potion data: %s", str);
+ return false;
+ }
+ // If we got here, we were successful
+ return true;
+}
+
+
+itemContainer::itemContainer()
+{
+ myuses = 0;
+ myitem = NULL;
+}
+
+itemContainer::itemContainer(item *i){
+ myuses = i->uses();
+ myitem = i;
+}
+itemContainer::itemContainer(const itemContainer &right)
+{
+ myuses = right.myuses;
+ myitem = right.myitem;
+}
+itemContainer::~itemContainer()
+{
+ myuses = 0;
+ myitem = NULL;
+}
+
+itemContainer &itemContainer::operator--()
+{
+ --myuses;
+ return *this;
+}
+
+itemContainer itemContainer::operator--(int)
+{
+ itemContainer oldValue = *this;
+
+ operator--();
+
+ return oldValue;
+}
+
+itemContainer &itemContainer::operator++()
+{
+ ++myuses;
+
+ return *this;
+}
+
+itemContainer itemContainer::operator++(int)
+{
+ itemContainer oldValue = *this;
+
+ operator++();
+
+ return oldValue;
+}
+
+void itemContainer::setItem(item *i)
+{
+ myitem = i;
+}
+
+bool itemContainer::operator<(const itemContainer &right) const
+{
+ return (*myitem < *right.myitem);
+}
+
+bool itemContainer::operator>(const itemContainer &right) const
+{
+ return (*myitem > *right.myitem);
+}
+
+bool itemContainer::operator==(const itemContainer &right) const
+{
+ return (*myitem == *right.myitem);
+}
+
+bool itemContainer::operator!=(const itemContainer &right) const
+{
+ return (*myitem == *right.myitem);
+}