[Pogamut-list] shutDownAgent()
yayu
pogamut-forum at artemis.ms.mff.cuni.cz
Sat Sep 26 15:00:31 CEST 2009
Re: shutDownAgent()
Author: yayu
hi, i don t tried using this method. I have always used a listener. you can use the follow example:
RcvMsgListener myPlayerKilledListener = new RcvMsgListener() {
@Override
public void receiveMessage(RcvMsgEvent e) {
PlayerKilled pk;
pk = (PlayerKilled) e.getMessage();
if (pk.killerID == getMemory().getAgentID()) {
//asesine al Agente X
Integer aux = (Integer)playerAsesinados.get(pk.UnrealID);
log.log(Level.INFO,"I kill the Player " + pk.killerID+ " kill me" );
} else if (pk.playerID == getMemory().getAgentID()) {
// me asesino el Agente x
log.log(Level.INFO, "I have killed by " + pk.UnrealID);
}
}
};
...
@Override
protected void postPrepareAgent() throws PogamutException {
//...
this.getBody().addTypedRcvMsgListener(myPlayerKilledListener, MessageType.PLAYER_KILLED);
}
sorry for my english,
matias.
More information about the Pogamut-list
mailing list