]> jfr.im git - irc/gameservirc.git/blobdiff - gameserv/item.h
still working on stuff for the items classes
[irc/gameservirc.git] / gameserv / item.h
index 0caed58fb521c306e6dab92829e00dd17a503fb5..6358089ae4fc6d0cc0750ee38d1fdbf074f51f57 100644 (file)
@@ -26,7 +26,7 @@ class item
   
   virtual bool use(Player *p) = 0;
   virtual void undo(Player *p) = 0;
-  virtual bool setData(const char *datastr) = 0;
+  virtual bool setData(char *datastr) = 0;
 
   type getType() {return mytype;};
   void setType(type);
@@ -35,6 +35,7 @@ class item
   bool operator>(const item &right) const;
   bool operator==(const item &right) const;
   bool operator!=(const item &right) const;
+  item &operator=(const item &right);
   
  protected:
   string myname;         // Name to use in game & sorting
@@ -80,9 +81,10 @@ class weapon : public item
   weapon(string name, int p=0, int uses = -1, long int identifier=0, int strength=0, int defense=0, int maxhp=0) : item(name, p, uses, strength, defense, maxhp){};
   ~weapon();
 
+  bool setData(char *datastr);
   bool use(Player *p);
   void undo(Player *p);
-  bool setData(const char *datastr);
+
 };
 
 class armor : public item
@@ -93,9 +95,9 @@ class armor : public item
   armor(string name, int p=0, int uses = -1, long int identifier=0, int strength=0, int defense=0, int maxhp=0) : item(name, p, uses, strength, defense, maxhp){};
   ~armor();
 
+  bool setData(char *datastr);
   bool use(Player *p);
   void undo(Player *p);
-  bool setData(const char *datastr);
 };
 
 class potion : public item
@@ -106,9 +108,9 @@ class potion : public item
   potion(string name, int p=0, int uses = 1, long int identifier=0, int strength=0, int defense=0, int maxhp=0, int hp=0, int forest_fights=0, int player_fights=0, int gold=0, int bank=0) : item(name, p, uses, strength, defense, maxhp, hp, forest_fights, player_fights, gold, bank){};
   ~potion();
 
+  bool setData(char *datastr);
   bool use(Player *p);
   void undo(Player *p);
-  bool setData(const char *datastr);
 
  protected:
   range myrange;