Class Neo
- java.lang.Object
-
- de.unistuttgart.informatik.fius.icge.simulation.entity.BasicEntity
-
- de.unistuttgart.informatik.fius.icge.simulation.entity.MovableEntity
-
- de.unistuttgart.informatik.fius.icge.simulation.entity.GreedyEntity
-
- de.unistuttgart.informatik.fius.jvk.provided.entity.Human
-
- de.unistuttgart.informatik.fius.jvk.provided.entity.Neo
-
- All Implemented Interfaces:
Entity,EntityCollector
public class Neo extends Human
The Neo entity- Author:
- Tim Neumann
-
-
Field Summary
-
Fields inherited from class de.unistuttgart.informatik.fius.icge.simulation.entity.GreedyEntity
inventoryOperationLock
-
Fields inherited from class de.unistuttgart.informatik.fius.icge.simulation.entity.BasicEntity
endOfLastEnqueuedOperation
-
-
Constructor Summary
Constructors Constructor Description Neo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanCollectCoin()booleancanDropCoin()voidcollectCoin()collects a coin from the actual fieldvoiddropCoin()drops a coin from Neo's inventory to the actual fieldintgetCoinsInWallet()List<Coin>getCurrentlyCollectableCoins()protected StringgetTextureHandle()protected voidsetCoins(int coins)Add the amount of coins to the inventoryvoidsetCoinsInWallet(int amountOfCoins)Helper Method that sets a fixed amount of coins for easier verification.-
Methods inherited from class de.unistuttgart.informatik.fius.jvk.provided.entity.Human
getZPosition
-
Methods inherited from class de.unistuttgart.informatik.fius.icge.simulation.entity.GreedyEntity
canCarry, collect, drop, drop, getCurrentlyCollectableEntities, getCurrentlyDroppableEntities, getInventory
-
Methods inherited from class de.unistuttgart.informatik.fius.icge.simulation.entity.MovableEntity
canMove, getDrawInformation, getLookingDirection, getLookingDirectionString, move, moveIfPossible, turnClockWise
-
Methods inherited from class de.unistuttgart.informatik.fius.icge.simulation.entity.BasicEntity
enqueueToPerformNewOperation, getPlayfield, getPosition, getSimulation, initOnPlayfield, isOnPlayfield, sleep, toString
-
-
-
-
Method Detail
-
getTextureHandle
protected String getTextureHandle()
- Specified by:
getTextureHandlein classBasicEntity
-
collectCoin
@InspectionMethod public void collectCoin()
collects a coin from the actual field- Throws:
NoCoinException- when there is no coin
-
dropCoin
@InspectionMethod public void dropCoin()
drops a coin from Neo's inventory to the actual field- Throws:
NeoIsBrokeException- when Neo is broken
-
canDropCoin
@InspectionAttribute public boolean canDropCoin()
- Returns:
- whether Neo can drop a coin
-
canCollectCoin
@InspectionAttribute public boolean canCollectCoin()
- Returns:
- whether there is a coin to collect
-
getCurrentlyCollectableCoins
public List<Coin> getCurrentlyCollectableCoins()
- Returns:
- a List of all Coins on Neos field
-
setCoins
protected void setCoins(int coins)
Add the amount of coins to the inventory- Parameters:
coins- the amount of coins to set
-
setCoinsInWallet
public void setCoinsInWallet(int amountOfCoins)
Helper Method that sets a fixed amount of coins for easier verification. Used in Verification of Task 2.1- Parameters:
amountOfCoins- the new amount of coins
-
getCoinsInWallet
@InspectionAttribute public int getCoinsInWallet()
- Returns:
- the number of coins in neos wallet
-
-