Reputation: 11
var max:int = (splitH ? height : width) - MIN_LEAF_SIZE;
What would this look like in java? I don't know what the as3 code is doing exactly...
Mainly the (splitH ? height : width
) is tripping me up.
Upvotes: 1
Views: 66
Reputation: 1784
It is as SLaks says.
If you would translate conditional operator line to if
and else
it would look something like this:
var max:int = 0;
if(splitH)
{
max = height - MIN_LEAF_SIZE;
}
else
{
max = width - MIN_LEAF_SIZE;
}
Upvotes: 0