protected void createEntityAt(final String clazz,final int type,final int x,final int y){
  logger.debug("creating " + clazz + ":"+ type+ " at "+ x+ ","+ y);
  final int ENTRY_POINT=0;
  final int ZONE_CHANGE=1;
  final int DOOR=6;
  final int PORTAL=4;
  final int PORTAL_STAIRS_DOWN=3;
  final int PORTAL_STAIRS_UP=2;
  final int ONE_WAY_PORTAL_DESTINATION=5;
  try {
    if (clazz.contains("logic/portal")) {
switch (type) {
case ENTRY_POINT:
case ZONE_CHANGE:
        setEntryPoint(x,y);
      break;
case ONE_WAY_PORTAL_DESTINATION:
case PORTAL_STAIRS_UP:
case PORTAL_STAIRS_DOWN:
    createLevelPortalAt(type,x,y);
  break;
case PORTAL:
break;
case DOOR:
break;
default :
logger.error("Unknown Portal (class/type: " + clazz + ":"+ type+ ") at ("+ x+ ","+ y+ ") of "+ getID()+ " found");
break;
}
}
 else if (clazz.contains("sheep.png")) {
final Sheep sheep=new Sheep();
sheep.setPosition(x,y);
add(sheep);
}
 else if (clazz.contains("logic/creature")) {
final EntityManager manager=SingletonRepository.getEntityManager();
if (manager.isCreature(clazz,type)) {
final Creature creature=manager.getCreature(clazz,type);
final CreatureRespawnPoint point=new CreatureRespawnPoint(this,x,y,creature,1);
add(point);
}
 else {
logger.error("Unknown Entity (class/type: " + clazz + ":"+ type+ ") at ("+ x+ ","+ y+ ") of "+ getID()+ " found");
}
}
 else if (clazz.contains("logic/item")) {
final PassiveEntityRespawnPoint passiveEntityrespawnPoint=PassiveEntityRespawnPointFactory.create(clazz,type,getID(),x,y);
if (passiveEntityrespawnPoint != null) {
passiveEntityrespawnPoint.setPosition(x,y);
add(passiveEntityrespawnPoint);
passiveEntityrespawnPoint.setStartState();
}
}
}
 catch (final RuntimeException e) {
logger.error("error creating entity " + type + " at ("+ x+ ","+ y+ ")",e);
}
}

protected void createEntityAt ( final String clazz , final int type , final int x , final int y ) { logger . debug ( "creating " + clazz + ":" + type + " at " + x + "," + y ) ; final int ENTRY_POINT = 0 ; final int ZONE_CHANGE = 1 ; final int DOOR = 6 ; final int PORTAL = 4 ; final int PORTAL_STAIRS_DOWN = 3 ; final int PORTAL_STAIRS_UP = 2 ; final int ONE_WAY_PORTAL_DESTINATION = 5 ; try { if ( clazz . contains ( "logic/portal" ) ) { switch ( type ) { case ENTRY_POINT : case ZONE_CHANGE : setEntryPoint ( x , y ) ; break ; case ONE_WAY_PORTAL_DESTINATION : case PORTAL_STAIRS_UP : case PORTAL_STAIRS_DOWN : createLevelPortalAt ( type , x , y ) ; break ; case PORTAL : break ; case DOOR : break ; default : logger . error ( "Unknown Portal (class/type: " + clazz + ":" + type + ") at (" + x + "," + y + ") of " + getID ( ) + " found" ) ; break ; } } else if ( clazz . contains ( "sheep.png" ) ) { final Sheep sheep = new Sheep ( ) ; sheep . setPosition ( x , y ) ; add ( sheep ) ; } else if ( clazz . contains ( "logic/creature" ) ) { final EntityManager manager = SingletonRepository . getEntityManager ( ) ; if ( manager . isCreature ( clazz , type ) ) { final Creature creature = manager . getCreature ( clazz , type ) ; final CreatureRespawnPoint point = new CreatureRespawnPoint ( this , x , y , creature , 1 ) ; add ( point ) ; } else { logger . error ( "Unknown Entity (class/type: " + clazz + ":" + type + ") at (" + x + "," + y + ") of " + getID ( ) + " found" ) ; } } else if ( clazz . contains ( "logic/item" ) ) { final PassiveEntityRespawnPoint passiveEntityrespawnPoint = PassiveEntityRespawnPointFactory . create ( clazz , type , getID ( ) , x , y ) ; if ( passiveEntityrespawnPoint != null ) { passiveEntityrespawnPoint . setPosition ( x , y ) ; add ( passiveEntityrespawnPoint ) ; passiveEntityrespawnPoint . setStartState ( ) ; } } } catch ( final RuntimeException e ) { logger . error ( "error creating entity " + type + " at (" + x + "," + y + ")" , e ) ; } }
create a map entity as a given coordinate .
