Server: Improve some log messages (#9820)
[oweals/minetest.git] / src / nodedef.h
1 /*
2 Minetest
3 Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20 #pragma once
21
22 #include "irrlichttypes_bloated.h"
23 #include <string>
24 #include <iostream>
25 #include <map>
26 #include "mapnode.h"
27 #include "nameidmapping.h"
28 #ifndef SERVER
29 #include "client/tile.h"
30 #include <IMeshManipulator.h>
31 class Client;
32 #endif
33 #include "itemgroup.h"
34 #include "sound.h" // SimpleSoundSpec
35 #include "constants.h" // BS
36 #include "texture_override.h" // TextureOverride
37 #include "tileanimation.h"
38
39 // PROTOCOL_VERSION >= 37
40 static const u8 CONTENTFEATURES_VERSION = 13;
41
42 class IItemDefManager;
43 class ITextureSource;
44 class IShaderSource;
45 class IGameDef;
46 class NodeResolver;
47
48 enum ContentParamType
49 {
50         CPT_NONE,
51         CPT_LIGHT,
52 };
53
54 enum ContentParamType2
55 {
56         CPT2_NONE,
57         // Need 8-bit param2
58         CPT2_FULL,
59         // Flowing liquid properties
60         CPT2_FLOWINGLIQUID,
61         // Direction for chests and furnaces and such
62         CPT2_FACEDIR,
63         // Direction for signs, torches and such
64         CPT2_WALLMOUNTED,
65         // Block level like FLOWINGLIQUID
66         CPT2_LEVELED,
67         // 2D rotation for things like plants
68         CPT2_DEGROTATE,
69         // Mesh options for plants
70         CPT2_MESHOPTIONS,
71         // Index for palette
72         CPT2_COLOR,
73         // 3 bits of palette index, then facedir
74         CPT2_COLORED_FACEDIR,
75         // 5 bits of palette index, then wallmounted
76         CPT2_COLORED_WALLMOUNTED,
77         // Glasslike framed drawtype internal liquid level, param2 values 0 to 63
78         CPT2_GLASSLIKE_LIQUID_LEVEL,
79 };
80
81 enum LiquidType
82 {
83         LIQUID_NONE,
84         LIQUID_FLOWING,
85         LIQUID_SOURCE,
86 };
87
88 enum NodeBoxType
89 {
90         NODEBOX_REGULAR, // Regular block; allows buildable_to
91         NODEBOX_FIXED, // Static separately defined box(es)
92         NODEBOX_WALLMOUNTED, // Box for wall mounted nodes; (top, bottom, side)
93         NODEBOX_LEVELED, // Same as fixed, but with dynamic height from param2. for snow, ...
94         NODEBOX_CONNECTED, // optionally draws nodeboxes if a neighbor node attaches
95 };
96
97 struct NodeBox
98 {
99         enum NodeBoxType type;
100         // NODEBOX_REGULAR (no parameters)
101         // NODEBOX_FIXED
102         std::vector<aabb3f> fixed;
103         // NODEBOX_WALLMOUNTED
104         aabb3f wall_top;
105         aabb3f wall_bottom;
106         aabb3f wall_side; // being at the -X side
107         // NODEBOX_CONNECTED
108         std::vector<aabb3f> connect_top;
109         std::vector<aabb3f> connect_bottom;
110         std::vector<aabb3f> connect_front;
111         std::vector<aabb3f> connect_left;
112         std::vector<aabb3f> connect_back;
113         std::vector<aabb3f> connect_right;
114         std::vector<aabb3f> disconnected_top;
115         std::vector<aabb3f> disconnected_bottom;
116         std::vector<aabb3f> disconnected_front;
117         std::vector<aabb3f> disconnected_left;
118         std::vector<aabb3f> disconnected_back;
119         std::vector<aabb3f> disconnected_right;
120         std::vector<aabb3f> disconnected;
121         std::vector<aabb3f> disconnected_sides;
122
123         NodeBox()
124         { reset(); }
125
126         void reset();
127         void serialize(std::ostream &os, u16 protocol_version) const;
128         void deSerialize(std::istream &is);
129 };
130
131 struct MapNode;
132 class NodeMetadata;
133
134 enum LeavesStyle {
135         LEAVES_FANCY,
136         LEAVES_SIMPLE,
137         LEAVES_OPAQUE,
138 };
139
140 enum AutoScale : u8 {
141         AUTOSCALE_DISABLE,
142         AUTOSCALE_ENABLE,
143         AUTOSCALE_FORCE,
144 };
145
146 enum WorldAlignMode : u8 {
147         WORLDALIGN_DISABLE,
148         WORLDALIGN_ENABLE,
149         WORLDALIGN_FORCE,
150         WORLDALIGN_FORCE_NODEBOX,
151 };
152
153 class TextureSettings {
154 public:
155         LeavesStyle leaves_style;
156         WorldAlignMode world_aligned_mode;
157         AutoScale autoscale_mode;
158         int node_texture_size;
159         bool opaque_water;
160         bool connected_glass;
161         bool use_normal_texture;
162         bool enable_mesh_cache;
163         bool enable_minimap;
164
165         TextureSettings() = default;
166
167         void readSettings();
168 };
169
170 enum NodeDrawType
171 {
172         // A basic solid block
173         NDT_NORMAL,
174         // Nothing is drawn
175         NDT_AIRLIKE,
176         // Do not draw face towards same kind of flowing/source liquid
177         NDT_LIQUID,
178         // A very special kind of thing
179         NDT_FLOWINGLIQUID,
180         // Glass-like, don't draw faces towards other glass
181         NDT_GLASSLIKE,
182         // Leaves-like, draw all faces no matter what
183         NDT_ALLFACES,
184         // Enabled -> ndt_allfaces, disabled -> ndt_normal
185         NDT_ALLFACES_OPTIONAL,
186         // Single plane perpendicular to a surface
187         NDT_TORCHLIKE,
188         // Single plane parallel to a surface
189         NDT_SIGNLIKE,
190         // 2 vertical planes in a 'X' shape diagonal to XZ axes.
191         // paramtype2 = "meshoptions" allows various forms, sizes and
192         // vertical and horizontal random offsets.
193         NDT_PLANTLIKE,
194         // Fenceposts that connect to neighbouring fenceposts with horizontal bars
195         NDT_FENCELIKE,
196         // Selects appropriate junction texture to connect like rails to
197         // neighbouring raillikes.
198         NDT_RAILLIKE,
199         // Custom Lua-definable structure of multiple cuboids
200         NDT_NODEBOX,
201         // Glass-like, draw connected frames and all visible faces.
202         // param2 > 0 defines 64 levels of internal liquid
203         // Uses 3 textures, one for frames, second for faces,
204         // optional third is a 'special tile' for the liquid.
205         NDT_GLASSLIKE_FRAMED,
206         // Draw faces slightly rotated and only on neighbouring nodes
207         NDT_FIRELIKE,
208         // Enabled -> ndt_glasslike_framed, disabled -> ndt_glasslike
209         NDT_GLASSLIKE_FRAMED_OPTIONAL,
210         // Uses static meshes
211         NDT_MESH,
212         // Combined plantlike-on-solid
213         NDT_PLANTLIKE_ROOTED,
214 };
215
216 // Mesh options for NDT_PLANTLIKE with CPT2_MESHOPTIONS
217 static const u8 MO_MASK_STYLE          = 0x07;
218 static const u8 MO_BIT_RANDOM_OFFSET   = 0x08;
219 static const u8 MO_BIT_SCALE_SQRT2     = 0x10;
220 static const u8 MO_BIT_RANDOM_OFFSET_Y = 0x20;
221 enum PlantlikeStyle {
222         PLANT_STYLE_CROSS,
223         PLANT_STYLE_CROSS2,
224         PLANT_STYLE_STAR,
225         PLANT_STYLE_HASH,
226         PLANT_STYLE_HASH2,
227 };
228
229 enum AlignStyle : u8 {
230         ALIGN_STYLE_NODE,
231         ALIGN_STYLE_WORLD,
232         ALIGN_STYLE_USER_DEFINED,
233 };
234
235 /*
236         Stand-alone definition of a TileSpec (basically a server-side TileSpec)
237 */
238
239 struct TileDef
240 {
241         std::string name = "";
242         bool backface_culling = true; // Takes effect only in special cases
243         bool tileable_horizontal = true;
244         bool tileable_vertical = true;
245         //! If true, the tile has its own color.
246         bool has_color = false;
247         //! The color of the tile.
248         video::SColor color = video::SColor(0xFFFFFFFF);
249         AlignStyle align_style = ALIGN_STYLE_NODE;
250         u8 scale = 0;
251
252         struct TileAnimationParams animation;
253
254         TileDef()
255         {
256                 animation.type = TAT_NONE;
257         }
258
259         void serialize(std::ostream &os, u16 protocol_version) const;
260         void deSerialize(std::istream &is, u8 contentfeatures_version,
261                 NodeDrawType drawtype);
262 };
263
264 #define CF_SPECIAL_COUNT 6
265
266 struct ContentFeatures
267 {
268         /*
269                 Cached stuff
270          */
271 #ifndef SERVER
272         // 0     1     2     3     4     5
273         // up    down  right left  back  front
274         TileSpec tiles[6];
275         // Special tiles
276         // - Currently used for flowing liquids
277         TileSpec special_tiles[CF_SPECIAL_COUNT];
278         u8 solidness; // Used when choosing which face is drawn
279         u8 visual_solidness; // When solidness=0, this tells how it looks like
280         bool backface_culling;
281 #endif
282
283         // Server-side cached callback existence for fast skipping
284         bool has_on_construct;
285         bool has_on_destruct;
286         bool has_after_destruct;
287
288         /*
289                 Actual data
290          */
291
292         // --- GENERAL PROPERTIES ---
293
294         std::string name; // "" = undefined node
295         ItemGroupList groups; // Same as in itemdef
296         // Type of MapNode::param1
297         ContentParamType param_type;
298         // Type of MapNode::param2
299         ContentParamType2 param_type_2;
300
301         // --- VISUAL PROPERTIES ---
302
303         enum NodeDrawType drawtype;
304         std::string mesh;
305 #ifndef SERVER
306         scene::IMesh *mesh_ptr[24];
307         video::SColor minimap_color;
308 #endif
309         float visual_scale; // Misc. scale parameter
310         TileDef tiledef[6];
311         // These will be drawn over the base tiles.
312         TileDef tiledef_overlay[6];
313         TileDef tiledef_special[CF_SPECIAL_COUNT]; // eg. flowing liquid
314         // If 255, the node is opaque.
315         // Otherwise it uses texture alpha.
316         u8 alpha;
317         // The color of the node.
318         video::SColor color;
319         std::string palette_name;
320         std::vector<video::SColor> *palette;
321         // Used for waving leaves/plants
322         u8 waving;
323         // for NDT_CONNECTED pairing
324         u8 connect_sides;
325         std::vector<std::string> connects_to;
326         std::vector<content_t> connects_to_ids;
327         // Post effect color, drawn when the camera is inside the node.
328         video::SColor post_effect_color;
329         // Flowing liquid or snow, value = default level
330         u8 leveled;
331
332         // --- LIGHTING-RELATED ---
333
334         bool light_propagates;
335         bool sunlight_propagates;
336         // Amount of light the node emits
337         u8 light_source;
338
339         // --- MAP GENERATION ---
340
341         // True for all ground-like things like stone and mud, false for eg. trees
342         bool is_ground_content;
343
344         // --- INTERACTION PROPERTIES ---
345
346         // This is used for collision detection.
347         // Also for general solidness queries.
348         bool walkable;
349         // Player can point to these
350         bool pointable;
351         // Player can dig these
352         bool diggable;
353         // Player can climb these
354         bool climbable;
355         // Player can build on these
356         bool buildable_to;
357         // Player cannot build to these (placement prediction disabled)
358         bool rightclickable;
359         u32 damage_per_second;
360         // client dig prediction
361         std::string node_dig_prediction;
362
363         // --- LIQUID PROPERTIES ---
364
365         // Whether the node is non-liquid, source liquid or flowing liquid
366         enum LiquidType liquid_type;
367         // If the content is liquid, this is the flowing version of the liquid.
368         std::string liquid_alternative_flowing;
369         // If the content is liquid, this is the source version of the liquid.
370         std::string liquid_alternative_source;
371         // Viscosity for fluid flow, ranging from 1 to 7, with
372         // 1 giving almost instantaneous propagation and 7 being
373         // the slowest possible
374         u8 liquid_viscosity;
375         // Is liquid renewable (new liquid source will be created between 2 existing)
376         bool liquid_renewable;
377         // Number of flowing liquids surrounding source
378         u8 liquid_range;
379         u8 drowning;
380         // Liquids flow into and replace node
381         bool floodable;
382
383         // --- NODEBOXES ---
384
385         NodeBox node_box;
386         NodeBox selection_box;
387         NodeBox collision_box;
388
389         // --- SOUND PROPERTIES ---
390
391         SimpleSoundSpec sound_footstep;
392         SimpleSoundSpec sound_dig;
393         SimpleSoundSpec sound_dug;
394
395         // --- LEGACY ---
396
397         // Compatibility with old maps
398         // Set to true if paramtype used to be 'facedir_simple'
399         bool legacy_facedir_simple;
400         // Set to true if wall_mounted used to be set to true
401         bool legacy_wallmounted;
402
403         /*
404                 Methods
405         */
406
407         ContentFeatures();
408         ~ContentFeatures() = default;
409         void reset();
410         void serialize(std::ostream &os, u16 protocol_version) const;
411         void deSerialize(std::istream &is);
412         /*!
413          * Since vertex alpha is no longer supported, this method
414          * adds opacity directly to the texture pixels.
415          *
416          * \param tiles array of the tile definitions.
417          * \param length length of tiles
418          */
419         void correctAlpha(TileDef *tiles, int length);
420
421         /*
422                 Some handy methods
423         */
424         bool isLiquid() const{
425                 return (liquid_type != LIQUID_NONE);
426         }
427         bool sameLiquid(const ContentFeatures &f) const{
428                 if(!isLiquid() || !f.isLiquid()) return false;
429                 return (liquid_alternative_flowing == f.liquid_alternative_flowing);
430         }
431
432         int getGroup(const std::string &group) const
433         {
434                 return itemgroup_get(groups, group);
435         }
436
437 #ifndef SERVER
438         void updateTextures(ITextureSource *tsrc, IShaderSource *shdsrc,
439                 scene::IMeshManipulator *meshmanip, Client *client, const TextureSettings &tsettings);
440 #endif
441 };
442
443 /*!
444  * @brief This class is for getting the actual properties of nodes from their
445  * content ID.
446  *
447  * @details The nodes on the map are represented by three numbers (see MapNode).
448  * The first number (param0) is the type of a node. All node types have own
449  * properties (see ContentFeatures). This class is for storing and getting the
450  * properties of nodes.
451  * The manager is first filled with registered nodes, then as the game begins,
452  * functions only get `const` pointers to it, to prevent modification of
453  * registered nodes.
454  */
455 class NodeDefManager {
456 public:
457         /*!
458          * Creates a NodeDefManager, and registers three ContentFeatures:
459          * \ref CONTENT_AIR, \ref CONTENT_UNKNOWN and \ref CONTENT_IGNORE.
460          */
461         NodeDefManager();
462         ~NodeDefManager();
463
464         /*!
465          * Returns the properties for the given content type.
466          * @param c content type of a node
467          * @return properties of the given content type, or \ref CONTENT_UNKNOWN
468          * if the given content type is not registered.
469          */
470         inline const ContentFeatures& get(content_t c) const {
471                 return
472                         c < m_content_features.size() ?
473                                 m_content_features[c] : m_content_features[CONTENT_UNKNOWN];
474         }
475
476         /*!
477          * Returns the properties of the given node.
478          * @param n a map node
479          * @return properties of the given node or @ref CONTENT_UNKNOWN if the
480          * given content type is not registered.
481          */
482         inline const ContentFeatures& get(const MapNode &n) const {
483                 return get(n.getContent());
484         }
485
486         /*!
487          * Returns the node properties for a node name.
488          * @param name name of a node
489          * @return properties of the given node or @ref CONTENT_UNKNOWN if
490          * not found
491          */
492         const ContentFeatures& get(const std::string &name) const;
493
494         /*!
495          * Returns the content ID for the given name.
496          * @param name a node name
497          * @param[out] result will contain the content ID if found, otherwise
498          * remains unchanged
499          * @return true if the ID was found, false otherwise
500          */
501         bool getId(const std::string &name, content_t &result) const;
502
503         /*!
504          * Returns the content ID for the given name.
505          * @param name a node name
506          * @return ID of the node or @ref CONTENT_IGNORE if not found
507          */
508         content_t getId(const std::string &name) const;
509
510         /*!
511          * Returns the content IDs of the given node name or node group name.
512          * Group names start with "group:".
513          * @param name a node name or node group name
514          * @param[out] result will be appended with matching IDs
515          * @return true if `name` is a valid node name or a (not necessarily
516          * valid) group name
517          */
518         bool getIds(const std::string &name, std::vector<content_t> &result) const;
519
520         /*!
521          * Returns the smallest box in integer node coordinates that
522          * contains all nodes' selection boxes. The returned box might be larger
523          * than the minimal size if the largest node is removed from the manager.
524          */
525         inline core::aabbox3d<s16> getSelectionBoxIntUnion() const {
526                 return m_selection_box_int_union;
527         }
528
529         /*!
530          * Checks whether a node connects to an adjacent node.
531          * @param from the node to be checked
532          * @param to the adjacent node
533          * @param connect_face a bit field indicating which face of the node is
534          * adjacent to the other node.
535          * Bits: +y (least significant), -y, -z, -x, +z, +x (most significant).
536          * @return true if the node connects, false otherwise
537          */
538         bool nodeboxConnects(MapNode from, MapNode to,
539                         u8 connect_face) const;
540
541         /*!
542          * Registers a NodeResolver to wait for the registration of
543          * ContentFeatures. Once the node registration finishes, all
544          * listeners are notified.
545          */
546         void pendNodeResolve(NodeResolver *nr) const;
547
548         /*!
549          * Stops listening to the NodeDefManager.
550          * @return true if the listener was registered before, false otherwise
551          */
552         bool cancelNodeResolveCallback(NodeResolver *nr) const;
553
554         /*!
555          * Registers a new node type with the given name and allocates a new
556          * content ID.
557          * Should not be called with an already existing name.
558          * @param name name of the node, must match with `def.name`.
559          * @param def definition of the registered node type.
560          * @return ID of the registered node or @ref CONTENT_IGNORE if
561          * the function could not allocate an ID.
562          */
563         content_t set(const std::string &name, const ContentFeatures &def);
564
565         /*!
566          * Allocates a blank node ID for the given name.
567          * @param name name of a node
568          * @return allocated ID or @ref CONTENT_IGNORE if could not allocate
569          * an ID.
570          */
571         content_t allocateDummy(const std::string &name);
572
573         /*!
574          * Removes the given node name from the manager.
575          * The node ID will remain in the manager, but won't be linked to any name.
576          * @param name name to be removed
577          */
578         void removeNode(const std::string &name);
579
580         /*!
581          * Regenerates the alias list (a map from names to node IDs).
582          * @param idef the item definition manager containing alias information
583          */
584         void updateAliases(IItemDefManager *idef);
585
586         /*!
587          * Replaces the textures of registered nodes with the ones specified in
588          * the texturepack's override.txt file
589          *
590          * @param overrides the texture overrides
591          */
592         void applyTextureOverrides(const std::vector<TextureOverride> &overrides);
593
594         /*!
595          * Only the client uses this. Loads textures and shaders required for
596          * rendering the nodes.
597          * @param gamedef must be a Client.
598          * @param progress_cbk called each time a node is loaded. Arguments:
599          * `progress_cbk_args`, number of loaded ContentFeatures, number of
600          * total ContentFeatures.
601          * @param progress_cbk_args passed to the callback function
602          */
603         void updateTextures(IGameDef *gamedef,
604                 void (*progress_cbk)(void *progress_args, u32 progress, u32 max_progress),
605                 void *progress_cbk_args);
606
607         /*!
608          * Writes the content of this manager to the given output stream.
609          * @param protocol_version serialization version of ContentFeatures
610          */
611         void serialize(std::ostream &os, u16 protocol_version) const;
612
613         /*!
614          * Restores the manager from a serialized stream.
615          * This clears the previous state.
616          * @param is input stream containing a serialized NodeDefManager
617          */
618         void deSerialize(std::istream &is);
619
620         /*!
621          * Used to indicate that node registration has finished.
622          * @param completed tells whether registration is complete
623          */
624         inline void setNodeRegistrationStatus(bool completed) {
625                 m_node_registration_complete = completed;
626         }
627
628         /*!
629          * Notifies the registered NodeResolver instances that node registration
630          * has finished, then unregisters all listeners.
631          * Must be called after node registration has finished!
632          */
633         void runNodeResolveCallbacks();
634
635         /*!
636          * Sets the registration completion flag to false and unregisters all
637          * NodeResolver instances listening to the manager.
638          */
639         void resetNodeResolveState();
640
641         /*!
642          * Resolves the IDs to which connecting nodes connect from names.
643          * Must be called after node registration has finished!
644          */
645         void mapNodeboxConnections();
646
647 private:
648         /*!
649          * Resets the manager to its initial state.
650          * See the documentation of the constructor.
651          */
652         void clear();
653
654         /*!
655          * Allocates a new content ID, and returns it.
656          * @return the allocated ID or \ref CONTENT_IGNORE if could not allocate
657          */
658         content_t allocateId();
659
660         /*!
661          * Binds the given content ID and node name.
662          * Registers them in \ref m_name_id_mapping and
663          * \ref m_name_id_mapping_with_aliases.
664          * @param i a content ID
665          * @param name a node name
666          */
667         void addNameIdMapping(content_t i, std::string name);
668
669         /*!
670          * Removes a content ID from all groups.
671          * Erases content IDs from vectors in \ref m_group_to_items and
672          * removes empty vectors.
673          * @param id Content ID
674          */
675         void eraseIdFromGroups(content_t id);
676
677         /*!
678          * Recalculates m_selection_box_int_union based on
679          * m_selection_box_union.
680          */
681         void fixSelectionBoxIntUnion();
682
683         //! Features indexed by ID.
684         std::vector<ContentFeatures> m_content_features;
685
686         //! A mapping for fast conversion between names and IDs
687         NameIdMapping m_name_id_mapping;
688
689         /*!
690          * Like @ref m_name_id_mapping, but maps only from names to IDs, and
691          * includes aliases too. Updated by \ref updateAliases().
692          * Note: Not serialized.
693          */
694         std::unordered_map<std::string, content_t> m_name_id_mapping_with_aliases;
695
696         /*!
697          * A mapping from group names to a vector of content types that belong
698          * to it. Necessary for a direct lookup in \ref getIds().
699          * Note: Not serialized.
700          */
701         std::unordered_map<std::string, std::vector<content_t>> m_group_to_items;
702
703         /*!
704          * The next ID that might be free to allocate.
705          * It can be allocated already, because \ref CONTENT_AIR,
706          * \ref CONTENT_UNKNOWN and \ref CONTENT_IGNORE are registered when the
707          * manager is initialized, and new IDs are allocated from 0.
708          */
709         content_t m_next_id;
710
711         //! True if all nodes have been registered.
712         bool m_node_registration_complete;
713
714         /*!
715          * The union of all nodes' selection boxes.
716          * Might be larger if big nodes are removed from the manager.
717          */
718         aabb3f m_selection_box_union;
719
720         /*!
721          * The smallest box in integer node coordinates that
722          * contains all nodes' selection boxes.
723          * Might be larger if big nodes are removed from the manager.
724          */
725         core::aabbox3d<s16> m_selection_box_int_union;
726
727         /*!
728          * NodeResolver instances to notify once node registration has finished.
729          * Even constant NodeDefManager instances can register listeners.
730          */
731         mutable std::vector<NodeResolver *> m_pending_resolve_callbacks;
732 };
733
734 NodeDefManager *createNodeDefManager();
735
736 class NodeResolver {
737 public:
738         NodeResolver();
739         virtual ~NodeResolver();
740         virtual void resolveNodeNames() = 0;
741
742         bool getIdFromNrBacklog(content_t *result_out,
743                 const std::string &node_alt, content_t c_fallback,
744                 bool error_on_fallback = true);
745         bool getIdsFromNrBacklog(std::vector<content_t> *result_out,
746                 bool all_required = false, content_t c_fallback = CONTENT_IGNORE);
747
748         void nodeResolveInternal();
749
750         u32 m_nodenames_idx = 0;
751         u32 m_nnlistsizes_idx = 0;
752         std::vector<std::string> m_nodenames;
753         std::vector<size_t> m_nnlistsizes;
754         const NodeDefManager *m_ndef = nullptr;
755         bool m_resolve_done = false;
756 };