Class GameState

  • Direct Known Subclasses:
    GameStateBuilder

    public class GameState
    extends Object
    The current state of the game at a given point in time.
    • Method Detail

      • getTurn

        public int getTurn()
        Number of turns completed.
      • getChargingPads

        public List<ChargingPad> getChargingPads()
        A list of exactly 2 charging pads. The beetle receives charge when it ends its turn on one of these.
      • getAntHill

        public AntHill getAntHill()
        The ant hill. Ants periodically appear from this hill. The frequency increases as the game goes on. Check its nextMove property to see how many turns until the next ant--one means it will be this turn, immediately after the beetle's action.
      • getBeads

        public List<Bead> getBeads()
        The beetle can collect beads to be used as ammunition against ants.

        There is a constant total number of beads in the game. (the beetle's ammo + the beads on the field)

      • getBeetle

        public Beetle getBeetle()
        Our protagonist, a robotic beetle that must keeps its battery charged while fighting off ants and avoiding the spider.
      • getSpider

        public Spider getSpider()
        The spider is unstoppable, but slow. It doesn't move every turn. Check its nextMove property to see how many turns until it moves again--one means it will be this turn, immediately after the beetle's action.
      • getAnts

        public List<Ant> getAnts()
        Ants always move toward the beetle. They move one space per turn, just like the beetle. They can be stopped by shooting beads (ammo) at them, but only when they are directly adjacent to the beetle in one of the four cardinal directions.

        Ants spawn from the ant hill at intervals.

      • getPlayerAt

        public ActingElement getPlayerAt​(int x,
                                         int y)
        Returns the beetle, spider, or ant at the given coordinate. No two of these are allowed to be in the same space at the same time.
      • getPlayerAt

        public ActingElement getPlayerAt​(Coord coordinate)
        Returns the beetle, spider, or ant at the given coordinate. No two of these are allowed to be in the same space at the same time.
      • getTerrainAt

        public GameElement getTerrainAt​(int x,
                                        int y)
        Returns the charging pad, ant hill, or bead at the given coordinate. No two of these are allowed to be in the same space at the same time.
      • getTerrainAt

        public GameElement getTerrainAt​(Coord coordinate)
        Returns the charging pad, ant hill, or bead at the given coordinate. No two of these are allowed to be in the same space at the same time.