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.80


these new versions now support implicit casting.
this means that one doesn't need to type
Code:
int x = EngFun.clamp((Var)3, (Var)4, (Var)5).IntValue;


anymore (although this is still supported), but now one can type :
Code:
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
Code:
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 :
Code:
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 :
Code:
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 :
Code:
z = 0



And as already mentioned, one can still only use explicit casting like with the previous versions!

Last edited by Stromausfall; 08/17/09 06:29.

get the C# wrapper:
for A7.85.4 and A8.30.4, Version 2.3.9
at http://acknexwrapper2.matthias-auer.net/ or visit the thread