Class SunImpl

java.lang.Object
pvzclone.model.impl.SunImpl
All Implemented Interfaces:
Entities, Sun

public final class SunImpl extends Object implements Sun
Implementation of the Sun interface.
  • Constructor Details

    • SunImpl

      public SunImpl(Pair<Integer,Integer> position, Integer speedYAxis)
      Parameters:
      position - starting position of the sun.
      speedYAxis - speed of movement.
  • Method Details

    • getPosition

      public Pair<Integer,Integer> getPosition()
      Specified by:
      getPosition in interface Entities
      Returns:
      position of the entity.
    • isAlive

      public boolean isAlive()
      Specified by:
      isAlive in interface Entities
      Returns:
      life state of the entity.
    • getEntityName

      public String getEntityName()
      Specified by:
      getEntityName in interface Entities
      Returns:
      name of the entity.
    • kill

      public void kill()
      Description copied from interface: Sun
      It kills the sun.
      Specified by:
      kill in interface Sun
    • getPoints

      public int getPoints()
      Specified by:
      getPoints in interface Sun
      Returns:
      the points obtained if the sun is touched (killed).
    • moveDown

      public void moveDown()
      Description copied from interface: Sun
      It changes the sun position in the y axis towards the bottom.
      Specified by:
      moveDown in interface Sun