mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
Add core.find_nodes_with_meta() script API
This commit is contained in:
parent
b45df9d6a7
commit
b785577f03
7 changed files with 89 additions and 20 deletions
|
@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "irr_v3d.h"
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
/*
|
||||
|
@ -42,10 +43,10 @@ class NodeMetadata
|
|||
public:
|
||||
NodeMetadata(IGameDef *gamedef);
|
||||
~NodeMetadata();
|
||||
|
||||
|
||||
void serialize(std::ostream &os) const;
|
||||
void deSerialize(std::istream &is);
|
||||
|
||||
|
||||
void clear();
|
||||
|
||||
// Generic key/value store
|
||||
|
@ -81,18 +82,20 @@ public:
|
|||
|
||||
void serialize(std::ostream &os) const;
|
||||
void deSerialize(std::istream &is, IGameDef *gamedef);
|
||||
|
||||
|
||||
// Add all keys in this list to the vector keys
|
||||
std::vector<v3s16> getAllKeys();
|
||||
// Get pointer to data
|
||||
NodeMetadata* get(v3s16 p);
|
||||
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:
|
||||
std::map<v3s16, NodeMetadata*> m_data;
|
||||
std::map<v3s16, NodeMetadata *> m_data;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue