Class Entities
java.lang.Object
ch.idsia.agents.controllers.modules.Entities
public class Entities
extends java.lang.Object
An
Entities
object provides information about entities around Mario.
In methods in this class, (mapX, mapY) are tile coordinates in the receptive field. In these coordinates, (0,0) is at the upper-left corner of the receptive field.
(relMapX, relMapY) are tile coordinates relative to Mario. In these coordinates, (0, 0) is Mario's position.
-
Field Summary
Fields Modifier and Type Field Description java.util.List<Entity>
entities
A list of all entities within Mario's receptive field.java.util.List<Entity>[][]
entityField
A 2-dimensional array of entities in the receptive field. -
Constructor Summary
Constructors Constructor Description Entities()
-
Method Summary
Modifier and Type Method Description boolean
anything(int relMapX, int relMapY)
Is there any entity at (relMapX, relMapY)?boolean
collectible(int relMapX, int relMapY)
Can I collect something at (relMapX, relMapY)?boolean
danger(int relMapX, int relMapY)
Is there anything dangerous at (relMapX, relMapY)?java.util.List<Entity>
entities(int relMapX, int relMapY)
Returns all entities at (relMapX, relMapY).EntityType
entityType(int relMapX, int relMapY)
Return the most dangerous entity type at (relMapX, relMapY).protected java.util.List<Entity>
getEntities(int mapX, int mapY)
Return all entities at (mapX, mapY).protected EntityType
getEntityType(int mapX, int mapY)
Returns the most dangerous entity type at (mapX, mapY).static boolean
isCollectible(Entity entity)
Is this entity collectible?static boolean
isDanger(Entity entity)
Return true if this entity is dangerous.static boolean
isShootable(Entity entity)
Is this entity shootable by fireball?static boolean
isSquishy(Entity entity)
Is this entity squishable by jumping on it (== destroyable)?boolean
nothing(int relMapX, int relMapY)
Is there no entity at (relMapX, relMapY)?void
reset(AgentOptions options)
boolean
shootable(int relMapX, int relMapY)
Can I shoot something at (relMapX, relMapY)?boolean
squishy(int relMapX, int relMapY)
Return true if Mario can squish something at (relMapX, relMapY).
-
Field Details
-
entityField
A 2-dimensional array of entities in the receptive field.Entities are indexed by row, then column: entityField[mapY, mapX] is the entity at (mapX, mapY).
Mario is at [marioEgoRow][marioEgoCol].
The array is
#receptiveFieldHeight
x#receptiveFieldWidth
in size. -
entities
A list of all entities within Mario's receptive field.
-
-
Constructor Details
-
Entities
public Entities()
-
-
Method Details
-
reset
-
getEntityType
Returns the most dangerous entity type at (mapX, mapY). The most dangerous entity is the one with the lowestEntityKind.getThreatLevel()
.- Parameters:
mapX
- absolute receptive field tile x-coordinatemapY
- absolute receptive field tile y-coordinate
-
getEntities
Return all entities at (mapX, mapY).- Parameters:
mapX
- absolute receptive field tile x-coordinatemapY
- absolute receptive field tile y-coordinate
-
entityType
Return the most dangerous entity type at (relMapX, relMapY). The most dangerous entity is the one with the lowestEntityKind.getThreatLevel()
. -
entities
Returns all entities at (relMapX, relMapY). -
anything
public boolean anything(int relMapX, int relMapY)Is there any entity at (relMapX, relMapY)? -
nothing
public boolean nothing(int relMapX, int relMapY)Is there no entity at (relMapX, relMapY)? -
danger
public boolean danger(int relMapX, int relMapY)Is there anything dangerous at (relMapX, relMapY)? -
isDanger
Return true if this entity is dangerous. -
squishy
public boolean squishy(int relMapX, int relMapY)Return true if Mario can squish something at (relMapX, relMapY). Note that this will return FALSE if there is non-squishable dangerous stuff there. -
isSquishy
Is this entity squishable by jumping on it (== destroyable)? -
shootable
public boolean shootable(int relMapX, int relMapY)Can I shoot something at (relMapX, relMapY)?If the tile is occupied by both shootable and non-shootable entities, this will return FALSE (to play safe).
-
isShootable
Is this entity shootable by fireball? -
collectible
public boolean collectible(int relMapX, int relMapY)Can I collect something at (relMapX, relMapY)?This will only return true if there is also nothing dangerous at that position.
-
isCollectible
Is this entity collectible?
-