Class BulletImpl

java.lang.Object
pvzclone.model.impl.BulletImpl
All Implemented Interfaces:
Bullet, Entities

public final class BulletImpl extends Object implements Bullet
Class that implements the interface Bullet.
  • Constructor Details

    • BulletImpl

      public BulletImpl(Integer speed, double damage, Pair<Integer,Integer> pos, String name)
      Parameters:
      speed - the speed of the bullet
      damage - the damage of the bullet
      pos - the position of the bullet
      name - the name of the bullet
  • 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.
    • getSpeed

      public double getSpeed()
      Specified by:
      getSpeed in interface Bullet
      Returns:
      the speed of the bullet.
    • getDamage

      public double getDamage()
      Specified by:
      getDamage in interface Bullet
      Returns:
      the damage of the bullet.
    • move

      public void move()
      Description copied from interface: Bullet
      moves the position of the bullet.
      Specified by:
      move in interface Bullet