Class HazardSquare
- java.lang.Object
-
- ai.nettogrof.battlesnake.info.hazard.AbstractHazard
-
- ai.nettogrof.battlesnake.info.hazard.HazardSquare
-
public class HazardSquare extends AbstractHazard
HazardSquad is the class that contain all the informations and related methods to hazards, using square to search- Version:
- Spring 2021
- Author:
- carl.lajeunesse
-
-
Field Summary
-
Fields inherited from class ai.nettogrof.battlesnake.info.hazard.AbstractHazard
hazard
-
-
Constructor Summary
Constructors Constructor Description HazardSquare(com.fasterxml.jackson.databind.JsonNode board)Single constructor need the jsonNode board
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description gnu.trove.list.array.TIntArrayListgetListHazard()Provide the arraylist of hazards.booleanisHazardSquare(int pos)Check if a particular square is an hazard square (based on square formula)protected voidsetInfo(com.fasterxml.jackson.databind.JsonNode hazardsInfo)Take the json field food and convert it into the arraylist hazard
-
-
-
Method Detail
-
setInfo
protected void setInfo(com.fasterxml.jackson.databind.JsonNode hazardsInfo)
Take the json field food and convert it into the arraylist hazard- Specified by:
setInfoin classAbstractHazard- Parameters:
hazardsInfo- JsonNode field hazard
-
isHazardSquare
public boolean isHazardSquare(int pos)
Check if a particular square is an hazard square (based on square formula)- Specified by:
isHazardSquarein classAbstractHazard- Parameters:
pos- the square position- Returns:
- boolean if square is hazard
-
getListHazard
public gnu.trove.list.array.TIntArrayList getListHazard()
Provide the arraylist of hazards.- Specified by:
getListHazardin classAbstractHazard- Returns:
- Arraylist int of hazards
-
-