@@ -139,7 +139,7 @@ struct MapNode
139
139
140
140
MapNode () = default ;
141
141
142
- MapNode (content_t content, u8 a_param1=0 , u8 a_param2=0 )
142
+ MapNode (content_t content, u8 a_param1=0 , u8 a_param2=0 ) noexcept
143
143
: param0(content),
144
144
param1 (a_param1),
145
145
param2(a_param2)
@@ -150,35 +150,35 @@ struct MapNode
150
150
MapNode (const NodeDefManager *ndef, const std::string &name,
151
151
u8 a_param1=0 , u8 a_param2=0 );
152
152
153
- bool operator ==(const MapNode &other)
153
+ bool operator ==(const MapNode &other) const noexcept
154
154
{
155
155
return (param0 == other.param0
156
156
&& param1 == other.param1
157
157
&& param2 == other.param2 );
158
158
}
159
159
160
160
// To be used everywhere
161
- content_t getContent () const
161
+ content_t getContent () const noexcept
162
162
{
163
163
return param0;
164
164
}
165
- void setContent (content_t c)
165
+ void setContent (content_t c) noexcept
166
166
{
167
167
param0 = c;
168
168
}
169
- u8 getParam1 () const
169
+ u8 getParam1 () const noexcept
170
170
{
171
171
return param1;
172
172
}
173
- void setParam1 (u8 p)
173
+ void setParam1 (u8 p) noexcept
174
174
{
175
175
param1 = p;
176
176
}
177
- u8 getParam2 () const
177
+ u8 getParam2 () const noexcept
178
178
{
179
179
return param2;
180
180
}
181
- void setParam2 (u8 p)
181
+ void setParam2 (u8 p) noexcept
182
182
{
183
183
param2 = p;
184
184
}
@@ -191,10 +191,9 @@ struct MapNode
191
191
*/
192
192
void getColor (const ContentFeatures &f, video::SColor *color) const ;
193
193
194
- void setLight (enum LightBank bank, u8 a_light, const ContentFeatures &f);
194
+ void setLight (LightBank bank, u8 a_light, const ContentFeatures &f) noexcept ;
195
195
196
- void setLight (enum LightBank bank, u8 a_light,
197
- const NodeDefManager *nodemgr);
196
+ void setLight (LightBank bank, u8 a_light, const NodeDefManager *nodemgr);
198
197
199
198
/* *
200
199
* Check if the light value for night differs from the light value for day.
@@ -203,17 +202,17 @@ struct MapNode
203
202
*/
204
203
bool isLightDayNightEq (const NodeDefManager *nodemgr) const ;
205
204
206
- u8 getLight (enum LightBank bank, const NodeDefManager *nodemgr) const ;
205
+ u8 getLight (LightBank bank, const NodeDefManager *nodemgr) const ;
207
206
208
207
/* !
209
208
* Returns the node's light level from param1.
210
209
* If the node emits light, it is ignored.
211
210
* \param f the ContentFeatures of this node.
212
211
*/
213
- u8 getLightRaw (enum LightBank bank, const ContentFeatures &f) const ;
212
+ u8 getLightRaw (LightBank bank, const ContentFeatures &f) const noexcept ;
214
213
215
214
/* *
216
- * This function differs from getLight(enum LightBank bank, NodeDefManager *nodemgr)
215
+ * This function differs from getLight(LightBank bank, NodeDefManager *nodemgr)
217
216
* in that the ContentFeatures of the node in question are not retrieved by
218
217
* the function itself. Thus, if you have already called nodemgr->get() to
219
218
* get the ContentFeatures you pass it to this function instead of the
@@ -227,7 +226,7 @@ struct MapNode
227
226
* @pre f != NULL
228
227
* @pre f->param_type == CPT_LIGHT
229
228
*/
230
- u8 getLightNoChecks (LightBank bank, const ContentFeatures *f) const ;
229
+ u8 getLightNoChecks (LightBank bank, const ContentFeatures *f) const noexcept ;
231
230
232
231
bool getLightBanks (u8 &lightday, u8 &lightnight,
233
232
const NodeDefManager *nodemgr) const ;
@@ -242,8 +241,7 @@ struct MapNode
242
241
return blend_light (daylight_factor, lightday, lightnight);
243
242
}
244
243
245
- u8 getFaceDir (const NodeDefManager *nodemgr,
246
- bool allow_wallmounted = false ) const ;
244
+ u8 getFaceDir (const NodeDefManager *nodemgr, bool allow_wallmounted = false ) const ;
247
245
u8 getWallMounted (const NodeDefManager *nodemgr) const ;
248
246
v3s16 getWallMountedDir (const NodeDefManager *nodemgr) const ;
249
247
@@ -254,25 +252,25 @@ struct MapNode
254
252
*
255
253
* \param p coordinates of the node
256
254
*/
257
- u8 getNeighbors (v3s16 p, Map *map);
255
+ u8 getNeighbors (v3s16 p, Map *map) const ;
258
256
259
257
/*
260
258
Gets list of node boxes (used for rendering (NDT_NODEBOX))
261
259
*/
262
260
void getNodeBoxes (const NodeDefManager *nodemgr, std::vector<aabb3f> *boxes,
263
- u8 neighbors = 0 );
261
+ u8 neighbors = 0 ) const ;
264
262
265
263
/*
266
264
Gets list of selection boxes
267
265
*/
268
266
void getSelectionBoxes (const NodeDefManager *nodemg,
269
- std::vector<aabb3f> *boxes, u8 neighbors = 0 );
267
+ std::vector<aabb3f> *boxes, u8 neighbors = 0 ) const ;
270
268
271
269
/*
272
270
Gets list of collision boxes
273
271
*/
274
272
void getCollisionBoxes (const NodeDefManager *nodemgr,
275
- std::vector<aabb3f> *boxes, u8 neighbors = 0 );
273
+ std::vector<aabb3f> *boxes, u8 neighbors = 0 ) const ;
276
274
277
275
/*
278
276
Liquid helpers
@@ -287,7 +285,7 @@ struct MapNode
287
285
*/
288
286
289
287
static u32 serializedLength (u8 version);
290
- void serialize (u8 *dest, u8 version);
288
+ void serialize (u8 *dest, u8 version) const ;
291
289
void deSerialize (u8 *source, u8 version);
292
290
293
291
// Serializes or deserializes a list of nodes in bulk format (first the
0 commit comments