I have just released
Version 1.0.2 for A6.60
Version 1.1.1.7 for A.77
Version 1.0.2 for A7.80these new versions now support
implicit casting.
this means that one doesn't need to type
int x = EngFun.clamp((Var)3, (Var)4, (Var)5).IntValue;
anymore (although this is still supported), but now one can type :
int x = EngFun.clamp(3, 4, 5);
thus explicit casting isn't needed anymore (although it's supported)
BUT one doesn't forget that if one writes
Var TempVar = new Var(3);
TempVar = 4;
then not the value of the TempVar object is changed, but a new object is created that has the value 4 ! Thus Var.IntValue and Var.FloatValue aren't obsolete and are still needed and useful ! For example if you want to change the position of an Entity :
ENTITY Dummy = EngFun.ent_create("dummy.mdl", new Vector(0, 0, 0), null);
MySky.z.IntValue += 30;
That's why you should use implicit casting with care, as it ALWAYS creates a new object and DOESN'T modify the existing object !
Another thing that i need to mention is that if one writes :
Var xxx = null;
int z = xxx;
normally implicit casting would fail here, that's why null is casted to 0 (like in lite-c). That means that the code above will result in :
And as already mentioned, one can still only use explicit casting like with the previous versions!