Package ai.nettogrof.battlesnake.info
Class GameRuleset
- java.lang.Object
 - 
- ai.nettogrof.battlesnake.info.GameRuleset
 
 
- 
public class GameRuleset extends Object
GameRuleset is the class that contain all the informations and related methods to Game ruleset- Version:
 - Spring 2022
 - Author:
 - carl.lajeunesse
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description private static StringCONSTRICTORConstant Field nameprivate intfoodSpawnChanceFood spawn chance (0% - 100%)private intgameTypegame type 0 = Standard 1 = constructor 2 = royale 3 = wrapped 4 = squadprivate inthazardDamageHazard damage per turnprivate intminimumFoodMinimum food on boardprivate static StringROYALEConstant Field nameprivate intskrinkSpeedprivate static StringSQUADConstant Field nameprivate SquadRulesetsquadRulesprivate static StringSTANDARDConstant Field nameprivate static StringWRAPPEDConstant Field name 
- 
Constructor Summary
Constructors Constructor Description GameRuleset(com.fasterxml.jackson.databind.JsonNode node)Object containing all game info 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplySquadRules(List<SnakeInfo> snakes)Apply Squad rule to all snakesintgetFoodSpawnChance()Get Food spawn chanceintgetGameType()Return game typeintgetHazardDamage()Get Damage per turnintgetMinimumFood()Get Minimum food on boardStringgetRuleset()Return game typeintgetSkrinkSpeed() 
 - 
 
- 
- 
Field Detail
- 
WRAPPED
private static final String WRAPPED
Constant Field name- See Also:
 - Constant Field Values
 
 
- 
CONSTRICTOR
private static final String CONSTRICTOR
Constant Field name- See Also:
 - Constant Field Values
 
 
- 
STANDARD
private static final String STANDARD
Constant Field name- See Also:
 - Constant Field Values
 
 
- 
SQUAD
private static final String SQUAD
Constant Field name- See Also:
 - Constant Field Values
 
 
- 
ROYALE
private static final String ROYALE
Constant Field name- See Also:
 - Constant Field Values
 
 
- 
hazardDamage
private final int hazardDamage
Hazard damage per turn 
- 
foodSpawnChance
private final int foodSpawnChance
Food spawn chance (0% - 100%) 
- 
minimumFood
private final int minimumFood
Minimum food on board 
- 
gameType
private final int gameType
game type 0 = Standard 1 = constructor 2 = royale 3 = wrapped 4 = squad 
- 
skrinkSpeed
private final int skrinkSpeed
 
- 
squadRules
private final SquadRuleset squadRules
 
 - 
 
- 
Method Detail
- 
getHazardDamage
public int getHazardDamage()
Get Damage per turn- Returns:
 - hazard Damage per Turn
 
 
- 
getFoodSpawnChance
public int getFoodSpawnChance()
Get Food spawn chance- Returns:
 - the foodSpawnChance
 
 
- 
getMinimumFood
public int getMinimumFood()
Get Minimum food on board- Returns:
 - the minimumFood
 
 
- 
getGameType
public int getGameType()
Return game type- Returns:
 - the gameType
 
 
- 
getRuleset
public String getRuleset()
Return game type- Returns:
 - the gameType
 
 
- 
applySquadRules
public void applySquadRules(List<SnakeInfo> snakes)
Apply Squad rule to all snakes- Parameters:
 snakes- list of snakes
 
- 
getSkrinkSpeed
public int getSkrinkSpeed()
- Returns:
 - skrink Speed (royale mode)
 
 
 - 
 
 -