Class AbstractHazard
- java.lang.Object
 - 
- ai.nettogrof.battlesnake.info.hazard.AbstractHazard
 
 
- 
- Direct Known Subclasses:
 HazardSquare
public abstract class AbstractHazard extends Object
Abstract hazard class- Version:
 - Fall 2021
 - Author:
 - carl.lajeunesse
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description protected gnu.trove.list.array.TIntArrayListhazardArraylist (int) of all hazard position (based on square formula) 
- 
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractHazard(com.fasterxml.jackson.databind.JsonNode board)Single constructor need the jsonNode board 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract gnu.trove.list.array.TIntArrayListgetListHazard()Provide the arraylist of hazards.abstract booleanisHazardSquare(int pos)Check if a particular square is an hazard square (based on square formula)protected abstract voidsetInfo(com.fasterxml.jackson.databind.JsonNode hazardsInfo)Take the json field food and convert it into the arraylist hazard 
 - 
 
- 
- 
Method Detail
- 
isHazardSquare
public abstract boolean isHazardSquare(int pos)
Check if a particular square is an hazard square (based on square formula)- Parameters:
 pos- the square position- Returns:
 - boolean if square is hazard
 
 
- 
setInfo
protected abstract void setInfo(com.fasterxml.jackson.databind.JsonNode hazardsInfo)
Take the json field food and convert it into the arraylist hazard- Parameters:
 hazardsInfo- JsonNode field hazard
 
- 
getListHazard
public abstract gnu.trove.list.array.TIntArrayList getListHazard()
Provide the arraylist of hazards.- Returns:
 - Arraylist int of hazards
 
 
 - 
 
 -