View Javadoc

1   package cz.cuni.amis.pogamut.sposh.ut2004.senses;
2   
3   import cz.cuni.amis.pogamut.sposh.context.UT2004Context;
4   import cz.cuni.amis.pogamut.sposh.engine.VariableContext;
5   import cz.cuni.amis.pogamut.sposh.executor.PrimitiveInfo;
6   import cz.cuni.amis.pogamut.sposh.executor.StateSense;
7   
8   /**
9    * Get current health of the bot.
10   * @author Honza
11   */
12  @PrimitiveInfo(name = "health", description = "Return how many points does bot have")
13  public class Health extends StateSense<UT2004Context, Integer> {
14  
15      public Health(UT2004Context ctx) {
16          super("health", ctx);
17      }
18  
19      @Override
20      public Integer query(VariableContext params) {
21          return ctx.getInfo().getHealth();
22      }
23  }