Advertisement

opCmp confusion

Started by August 24, 2011 03:51 PM
1 comment, last by WitchLord 13 years, 3 months ago
So I was looking to use the new find function in the array extension and found that I can't use it due to not having opCmp overloaded in my class (despite the array being an array of handles.) The documentation says we should return an int from this overload, but doesn't say what values the engine is expecting. Can we get some clarification on this matter?
opCmp should return 0 if the two objects are equal, a number less than 0 if the first object is less than the second element and a number greater than 0 if the first element is greater than the second element.
Advertisement
I see this information is missing in the manual, though it may be implicitly understood from 'a op b' being rewritten as 'a.opCmp(b) op 0'.

I'll have that fixed to make it more explicit.

Thanks,
Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement