Class SquadRuleset


  • public class SquadRuleset
    extends Object
    SquadRuleset is the class that contain all the informations and related methods to Squad ruleset
    Version:
    Summer 2022
    Author:
    carl.lajeunesse
    • Field Detail

      • allowBodyCollisions

        private final boolean allowBodyCollisions
      • sharedElimination

        private final boolean sharedElimination
      • sharedHealth

        private final boolean sharedHealth
      • sharedLength

        private final boolean sharedLength
    • Constructor Detail

      • SquadRuleset

        public SquadRuleset​(com.fasterxml.jackson.databind.JsonNode node)
        Parameters:
        node - Json node info about squad rules
    • Method Detail

      • isAllowBodyCollisions

        public boolean isAllowBodyCollisions()
        Returns:
        the allowBodyCollisions
      • isSharedElimination

        public boolean isSharedElimination()
        Returns:
        the sharedElimination
      • isSharedHealth

        public boolean isSharedHealth()
        Returns:
        the sharedHealth
      • isSharedLength

        public boolean isSharedLength()
        Returns:
        the sharedLength
      • applyRules

        public void applyRules​(List<SnakeInfo> snakes)
        Parameters:
        snakes - List of snakes