mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-22 17:18:39 +00:00
Enhance ABM performance a little bit by removing two std::set copy (#5815)
* Enhance ABM performance a little bit by removing two std::set copy * ActiveBlockModifier::getTriggerContents now returns a const ref * ActiveBlockModifier::getRequiredNeighbors now returns a const ref * ActiveBlockModifier::getRequiredNeighbors is now purely virtual * Little code style fix
This commit is contained in:
parent
5b338638e0
commit
4d5ce8478c
3 changed files with 18 additions and 21 deletions
|
@ -51,11 +51,10 @@ public:
|
|||
virtual ~ActiveBlockModifier(){};
|
||||
|
||||
// Set of contents to trigger on
|
||||
virtual std::set<std::string> getTriggerContents()=0;
|
||||
virtual const std::set<std::string> &getTriggerContents() const = 0;
|
||||
// Set of required neighbors (trigger doesn't happen if none are found)
|
||||
// Empty = do not check neighbors
|
||||
virtual std::set<std::string> getRequiredNeighbors()
|
||||
{ return std::set<std::string>(); }
|
||||
virtual const std::set<std::string> &getRequiredNeighbors() const = 0;
|
||||
// Trigger interval in seconds
|
||||
virtual float getTriggerInterval() = 0;
|
||||
// Random chance of (1 / return value), 0 is disallowed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue