Class GameImpl

java.lang.Object
pvzclone.model.impl.GameImpl
All Implemented Interfaces:
Game

public final class GameImpl extends Object implements Game
class that implements the interface Game.
  • Constructor Details

    • GameImpl

      public GameImpl(World world)
      Parameters:
      world - is the world.
  • Method Details

    • isOver

      public boolean isOver()
      Description copied from interface: Game
      Checks if the game is over.
      Specified by:
      isOver in interface Game
      Returns:
      true if the game is over, false otherwise.
    • update

      public void update(long elapsed)
      Description copied from interface: Game
      update the whole game.
      Specified by:
      update in interface Game
      Parameters:
      elapsed - is the current time
    • createPlant

      public boolean createPlant(Pair<Integer,Integer> position)
      Description copied from interface: Game
      Create a new plant.
      Specified by:
      createPlant in interface Game
      Parameters:
      position - is the position of the new plant
      Returns:
      true if the plant is created, else false
    • getGameState

      public GameState getGameState()
      Description copied from interface: Game
      Retrieves the current state of the game.
      Specified by:
      getGameState in interface Game
      Returns:
      the current state of the game.
    • getEntities

      public Set<Entities> getEntities()
      Description copied from interface: Game
      Retrieves the set of entities present in the game. Entities represent the elements in the game world.
      Specified by:
      getEntities in interface Game
      Returns:
      a Set of Entities representing the elements in the game world.