* Iterate through each zone and select the min and max rat count based on zone size
* Places rat if possible, if not skip this rat (so if 6 rats chosen perhaps only 3 are placed)
*/
private void summonRats() {
final EntityManager manager = SingletonRepository.getEntityManager();
final RatsObserver ratsObserver = new RatsObserver();
// generating rats in zones
for(int j=0; j<(RAT_ZONES.size()); j++) {
final StendhalRPZone zone = (StendhalRPZone) SingletonRepository.getRPWorld().getRPZone(
RAT_ZONES.get(j));
final int maxRats = (int) Math.round(Math.sqrt(zone.getWidth()*zone.getHeight())/4);
final int minRats = (int) Math.round(Math.sqrt(zone.getWidth()*zone.getHeight())/12);
final int ratsCount = Rand.rand(maxRats-minRats)+minRats;
logger.debug(ratsCount+ " rats selected at " + zone.getName());
for(int i=0 ; i<ratsCount; i++) {
final int x=Rand.rand(zone.getWidth());
final int y=Rand.rand(zone.getHeight());
// Gaussian distribution
int tc=Rand.randGaussian(0,RAT_TYPES.size());
if ((tc>(RAT_TYPES.size()-1)) || (tc<0)) {
tc=0;
}
// checking if EntityManager knows about this creature type.
final Creature tempCreature = new Creature((Creature) manager.getEntity(RAT_TYPES.get(tc)));
final Creature rat = new Creature(tempCreature.getNewInstance());
// chosen place is occupied
if (zone.collides(rat,x,y)) {
// Could not place the creature here.