AFAIK you can explicit downcast them. If they return a null pointer, they're not of that type.
eg if player(myEntity2D) 'myEntity2D is a player.
However this is dangerous as any objects that extend player will work, even though they strictly speaking aren't players.
It would be better to solve this problem using polymorphism.
eg if player(myEntity2D) 'myEntity2D is a player.
However this is dangerous as any objects that extend player will work, even though they strictly speaking aren't players.
It would be better to solve this problem using polymorphism.