Commit bf243270 authored by Arnaud Guerquin's avatar Arnaud Guerquin
Browse files

try catch

parent 0c9c0668
......@@ -7,9 +7,6 @@ import core.gamestate.GameContent;
import core.relayer.Relayer;
import core.zone.Direction;
import core.gamestate.Character;
import core.gamestate.Entity;
import core.gamestate.GameState;
import core.gamestate.EntityNotFoundExeption;
import java.util.*;
/** The AbstractEntity generated for the IA implied by the FollowerBehaviour in BehaviourHolder
......@@ -27,7 +24,12 @@ public class IGPEntity extends AbstractEntity {
@Override
public void act() {
FollowerBehaviour fb = behold.GetFollowerBehaviour();
List <Character> chlist = gameState.getAllCharacters();
List <Character> chlist=null;
try{
gameState.getAllCharacters();
}catch(InterruptedException e){
return;
}
/* TODO : ne garder que les personnages visibles ? */
Character victim = fb.FindTarget(chlist);
String action = fb.getAction();
......@@ -76,8 +78,12 @@ public class IGPEntity extends AbstractEntity {
/*TODO : Soigner victim */
break;
default:
Entity owner =null;
try {
Entity owner = gameState.getEntity(relayer.getCharacter().getOwner());
owner = gameState.getEntity(relayer.getCharacter().getOwner());
}catch(Exception e){
return;
}
int dX3 = owner.getX();
int dY3 = owner.getY();
int sX3 = relayer.getCharacter().getX();
......@@ -85,8 +91,5 @@ public class IGPEntity extends AbstractEntity {
Direction dir3 = AI.alpha_star(map,sX3, sY3, dX3, dY3,map.getWidth(),map.getHeight());
this.relayer.move(dir3);
}
catch (EntityNotFoundExeption e) {
}
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment