23 template <
bool cond,
typename T>
24 using enableIf =
typename std::enable_if<cond, T>::type;
30 #define DECL_PARAM_SRZRS(type) \
31 void serializeParameterValue (std::ostream& os, type v); \
32 void deSerializeParameterValue(std::istream& is, type& r);
33 #define DECL_PARAM_OVERLOADS(type) DECL_PARAM_SRZRS(type) \
34 type interpolateParameterValue(float fac, const type a, const type b); \
35 type pickParameterValue (float* facs, const type a, const type b);
60 template <typename E, enableIf<std::is_enum<E>::value,
bool> =
true>
65 template <typename E, enableIf<std::is_enum<E>::value,
bool> =
true>
67 std::underlying_type_t<E> v;
73 template <
typename T,
size_t PN>
84 template <
typename... Args>
94 return interpolateParameterValue(fac, this->val, against.
val);
99 return pickParameterValue(f, a.
val, b.
val);
102 operator T()
const {
return val; }
109 template <
typename T,
size_t N>
112 template <
typename... Args>
116 template <
typename T,
size_t PN>
119 return std::to_string(
p.val);
122 template <
typename T,
size_t N>
125 std::ostringstream oss;
136 template <
typename T>
167 r.
min =
min.interpolate(fac, against.
min);
168 r.
max =
max.interpolate(fac, against.
max);
177 template <
typename T>
180 std::ostringstream s;
183 s <<
" :: " << r.
bias;
193 template <
typename T>
211 T
blend(
float fac)
const;
217 template <
typename T>
220 std::ostringstream s;
249 #undef DECL_PARAM_SRZRS
250 #undef DECL_PARAM_OVERLOADS
265 void serialize(std::ostream &os, u16 protocol_ver,
bool newPropertiesOnly =
false,
266 bool skipAnimation =
false)
const;
267 void deSerialize(std::istream &is, u16 protocol_ver,
bool newPropertiesOnly =
false,
268 bool skipAnimation =
false);
310 void serialize(std::ostream &os, u16 protocol_ver)
const;
311 void deSerialize(std::istream &is, u16 protocol_ver);
core::vector2d< f32 > v2f
Definition irr_v2d.h:11
core::vector3df v3f
Definition irr_v3d.h:11
#define CONTENT_IGNORE
Definition mapnode.h:58
Definition particles.cpp:108
std::string dump(const Parameter< T, PN > &p)
Definition particles.h:117
typename std::enable_if< cond, T >::type enableIf
Definition particles.h:24
void serializeParameterValue(std::ostream &os, E k)
Definition particles.h:61
T(float, T, T) BlendFunction
Definition particles.h:29
void deSerializeParameterValue(std::istream &is, E &k)
Definition particles.h:66
TweenStyle
Definition particles.h:190
BlendMode
Definition particles.h:237
AttractorKind
Definition particles.h:235
#define DECL_PARAM_OVERLOADS(type)
Definition particles.h:33
Definition particles.h:272
bool object_collision
Definition particles.h:275
MapNode node
Definition particles.h:280
bool collisiondetection
Definition particles.h:273
struct TileAnimationParams animation
Definition particles.h:278
ServerParticleTexture texture
Definition particles.h:277
void copyCommon(CommonParticleParams &to) const
Definition particles.h:290
u8 glow
Definition particles.h:279
bool collision_removal
Definition particles.h:274
bool vertical
Definition particles.h:276
CommonParticleParams()
Definition particles.h:283
u8 node_tile
Definition particles.h:281
void setContent(content_t c) noexcept
Definition mapnode.h:166
Definition particles.h:75
T ValType
Definition particles.h:76
T val
Definition particles.h:79
Parameter(Args... args)
Definition particles.h:85
virtual T interpolate(float fac, const This &against) const
Definition particles.h:92
virtual void deSerialize(std::istream &is)
Definition particles.h:89
T operator=(T b)
Definition particles.h:103
static T pick(float *f, const This &a, const This &b)
Definition particles.h:97
float[PN] pickFactors
Definition particles.h:77
virtual void serialize(std::ostream &os) const
Definition particles.h:87
Definition particles.h:138
T ValType
Definition particles.h:139
T max
Definition particles.h:142
f32 bias
Definition particles.h:143
T pickWithin() const
Definition particles.cpp:28
void deSerialize(std::istream &is)
Definition particles.cpp:19
T min
Definition particles.h:142
void legacySerialize(std::ostream &os) const
Definition particles.h:150
void legacyDeSerialize(std::istream &is)
Definition particles.h:155
RangedParameter(M b)
Definition particles.h:147
RangedParameter()=default
void serialize(std::ostream &os) const
Definition particles.cpp:11
RangedParameter(T _min, T _max)
Definition particles.h:146
This interpolate(float fac, const This against) const
Definition particles.h:164
Definition particles.h:195
TweenedParameter()=default
TweenedParameter(M b)
Definition particles.h:208
void deSerialize(std::istream &is)
Definition particles.cpp:97
T start
Definition particles.h:203
void serialize(std::ostream &os) const
Definition particles.cpp:87
T ValType
Definition particles.h:196
f32 beginning
Definition particles.h:201
TweenedParameter(T _start, T _end)
Definition particles.h:206
T end
Definition particles.h:203
u16 reps
Definition particles.h:200
TweenStyle style
Definition particles.h:199
Definition particles.h:110
VectorParameter(Args... args)
Definition particles.h:113
Definition particles.h:304
v3f pos
Definition particles.h:305
void serialize(std::ostream &os, u16 protocol_ver) const
Definition particles.cpp:232
v3f acc
Definition particles.h:305
v3f vel
Definition particles.h:305
v3f drag
Definition particles.h:305
ParticleParamTypes::v3fRange jitter
Definition particles.h:308
f32 size
Definition particles.h:306
f32 expirationtime
Definition particles.h:306
void deSerialize(std::istream &is, u16 protocol_ver)
Definition particles.cpp:266
ParticleParamTypes::f32Range bounce
Definition particles.h:307
Definition particles.h:315
ParticleParamTypes::v3fTween attractor_direction
Definition particles.h:327
ParticleParamTypes::v3fRangeTween vel
Definition particles.h:322
std::vector< ServerParticleTexture > texpool
Definition particles.h:319
u16 amount
Definition particles.h:316
ParticleParamTypes::v3fRangeTween jitter
Definition particles.h:322
ParticleParamTypes::AttractorKind attractor_kind
Definition particles.h:325
ParticleParamTypes::v3fRangeTween drag
Definition particles.h:322
u16 attractor_attachment
Definition particles.h:329
ParticleParamTypes::v3fRangeTween pos
Definition particles.h:322
ParticleParamTypes::v3fRangeTween radius
Definition particles.h:322
u16 attractor_direction_attachment
Definition particles.h:330
ParticleParamTypes::f32RangeTween attract
Definition particles.h:337
ParticleParamTypes::v3fTween attractor_origin
Definition particles.h:327
ParticleParamTypes::f32RangeTween bounce
Definition particles.h:338
f32 time
Definition particles.h:317
ParticleParamTypes::v3fRangeTween acc
Definition particles.h:322
ParticleParamTypes::f32RangeTween size
Definition particles.h:336
ParticleParamTypes::f32RangeTween exptime
Definition particles.h:335
bool attractor_kill
Definition particles.h:332
Definition particles.h:254
bool animated
Definition particles.h:255
ParticleParamTypes::BlendMode blendmode
Definition particles.h:256
ParticleParamTypes::f32Tween alpha
Definition particles.h:258
ParticleParamTypes::v2fTween scale
Definition particles.h:259
TileAnimationParams animation
Definition particles.h:257
Definition particles.h:263
void serialize(std::ostream &os, u16 protocol_ver, bool newPropertiesOnly=false, bool skipAnimation=false) const
Definition particles.cpp:185
std::string string
Definition particles.h:264
void deSerialize(std::istream &is, u16 protocol_ver, bool newPropertiesOnly=false, bool skipAnimation=false)
Definition particles.cpp:208
Definition tileanimation.h:18
enum TileAnimationType type
Definition tileanimation.h:19
static std::string p(std::string path)
Definition test_filesys.cpp:53
@ TAT_NONE
Definition tileanimation.h:12