Wabbitseason Wabbitseason - 4 months ago 25
Java Question

Is there really no size() method on a LibGDX Array?

According to the LibGDX API documentation the

Array
class does not implement
size()
or
length()
or
count()
or any similar method for returning the number of items currently in the collection.

Of course I can iterate over the values and just count them manually, but the developers must have had a good reason for omitting it as a method.

What's the explanation for this? Am I just overlooking something trivial?

Answer

Am I just overlooking something trivial?

Yes. You are missing the public Array.size field.