Drawing order of Objects in an Arraylist

I didn’t try it yet. But I see you wrote g.z == allowed

Wouldn’t that g.z mean that I need to make a new function inside of the class?