public class HunterPreyEnvironmentService extends AbstractEnvironmentService implements IHunterPreyEnvironmentService
DIRECTION_DOWN, DIRECTION_LEFT, DIRECTION_NONE, DIRECTION_RIGHT, DIRECTION_UP| Constructor and Description |
|---|
HunterPreyEnvironmentService(String spacename)
Create an environment service for a given space.
|
| Modifier and Type | Method and Description |
|---|---|
IFuture<Void> |
eat(IFood food)
Perform an eat action for the avatar of the calling component.
|
IFuture<Void> |
move(String direction)
Perform a move action for the avatar of the calling component.
|
ISubscriptionIntermediateFuture<Collection<IPreyPerceivable>> |
registerPrey()
Register the calling component as a prey.
|
performAction, registerpublic HunterPreyEnvironmentService(String spacename)
spacename - The name of the space instance.public ISubscriptionIntermediateFuture<Collection<IPreyPerceivable>> registerPrey()
registerPrey in interface IHunterPreyEnvironmentServicepublic IFuture<Void> move(String direction)
move in interface IHunterPreyEnvironmentServicedirection - The move direction.public IFuture<Void> eat(IFood food)
eat in interface IHunterPreyEnvironmentServicefood - The food to eat.Copyright © 2013. All Rights Reserved.