mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-09-05 14:58:27 +00:00
Add more modular saving of config data for items (#1591)
* stubbing for saving item extra data * add declaration to header * modularize loading for all possible extra data * move logic to Item * remove extra map
This commit is contained in:
@@ -9,6 +9,10 @@
|
||||
#include "eInventoryType.h"
|
||||
#include "eLootSourceType.h"
|
||||
|
||||
namespace tinyxml2 {
|
||||
class XMLElement;
|
||||
};
|
||||
|
||||
/**
|
||||
* An item that can be stored in an inventory and optionally consumed or equipped
|
||||
* TODO: ideally this should be a component
|
||||
@@ -116,6 +120,12 @@ public:
|
||||
*/
|
||||
std::vector<LDFBaseData*>& GetConfig();
|
||||
|
||||
/**
|
||||
* Returns current config info for this item, e.g. for rockets
|
||||
* @return current config info for this item
|
||||
*/
|
||||
std::vector<LDFBaseData*> GetConfig() const;
|
||||
|
||||
/**
|
||||
* Returns the database info for this item
|
||||
* @return the database info for this item
|
||||
@@ -214,6 +224,10 @@ public:
|
||||
*/
|
||||
void RemoveFromInventory();
|
||||
|
||||
void SaveConfigXml(tinyxml2::XMLElement& i) const;
|
||||
|
||||
void LoadConfigXml(const tinyxml2::XMLElement& i);
|
||||
|
||||
private:
|
||||
/**
|
||||
* The object ID of this item
|
||||
|
Reference in New Issue
Block a user