aboutsummaryrefslogtreecommitdiff
path: root/assets/manual_img/screenshot_20161203_230644.png
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2018-11-29 16:59:07 +0100
committerorwell96 <orwell@bleipb.de>2018-11-29 17:00:57 +0100
commit01ffee4d58316c74c90a36b491770ee358fd3f98 (patch)
treedc0b6163f68101a276d28097211370b9e5182b73 /assets/manual_img/screenshot_20161203_230644.png
parent0f295ec4a94b25920d4ac1e107cfc469a70c8455 (diff)
downloadadvtrains-01ffee4d58316c74c90a36b491770ee358fd3f98.tar.gz
advtrains-01ffee4d58316c74c90a36b491770ee358fd3f98.tar.bz2
advtrains-01ffee4d58316c74c90a36b491770ee358fd3f98.zip
Implement new position encoding function and benchmark it
This shall replace all "pos_to_string" hashes in the long term. Performs a bit better than pos_to_string (but still worse than the "nested tables" layout the nodedb uses (an unmatched open parenthesis leaves a tension that will stay all day... 2 do even more
Diffstat (limited to 'assets/manual_img/screenshot_20161203_230644.png')
0 files changed, 0 insertions, 0 deletions
NodeMetadata : public Metadata { public: NodeMetadata(IItemDefManager *item_def_mgr); ~NodeMetadata(); void serialize(std::ostream &os, u8 version, bool disk=true) const; void deSerialize(std::istream &is, u8 version); void clear(); bool empty() const; // The inventory Inventory *getInventory() { return m_inventory; } inline bool isPrivate(const std::string &name) const { return m_privatevars.count(name) != 0; } void markPrivate(const std::string &name, bool set); private: int countNonPrivate() const; Inventory *m_inventory; std::unordered_set<std::string> m_privatevars; }; /* List of metadata of all the nodes of a block */ class NodeMetadataList { public: ~NodeMetadataList(); void serialize(std::ostream &os, u8 blockver, bool disk=true) const; void deSerialize(std::istream &is, IItemDefManager *item_def_mgr); // Add all keys in this list to the vector keys std::vector<v3s16> getAllKeys(); // Get pointer to data NodeMetadata *get(v3s16 p); // Deletes data void remove(v3s16 p); // Deletes old data and sets a new one void set(v3s16 p, NodeMetadata *d); // Deletes all void clear(); private: int countNonEmpty() const; std::map<v3s16, NodeMetadata *> m_data; };