generateRandomTarget

final Cell generateRandomTarget(GameEntity entity, Random random)

Generate a random cell in bounds of this grid which is not occupied by entity.

This method can be used by an entity to use a random target for an attack and not attack itself.

Parameters

entity

The entity which cells are excluded.

random

Random number generator. Optional.

Throws

If too many attempts were used.