java.lang.Object
me.deecaad.weaponmechanics.weapon.shoot.spread.SpreadImage
All Implemented Interfaces:
me.deecaad.core.file.Serializer<SpreadImage>

public class SpreadImage extends Object implements me.deecaad.core.file.Serializer<SpreadImage>
  • Constructor Details

    • SpreadImage

      public SpreadImage()
      Default constructor for serializer
    • SpreadImage

      public SpreadImage(Sprite sprite, double fovWidth, double fovHeight)
  • Method Details

    • getHeight

      public int getHeight()
    • getWidth

      public int getWidth()
    • getLocations

      public Set<Point> getLocations(int amount)
      Gets a given number of random points (x, y) from this.points using the value of that point as the chance for that point to be selected.

      If not enough points are found in the allowed number of checks, then random points are selected, not taking the point's value into account

      Parameters:
      amount - Number of points to get
      Returns:
      The found points
    • getLocation

      public Point getLocation()
    • getKeyword

      public String getKeyword()
      Specified by:
      getKeyword in interface me.deecaad.core.file.Serializer<SpreadImage>
    • serialize

      @NotNull public SpreadImage serialize(@NotNull me.deecaad.core.file.SerializeData data) throws me.deecaad.core.file.SerializerException
      Specified by:
      serialize in interface me.deecaad.core.file.Serializer<SpreadImage>
      Throws:
      me.deecaad.core.file.SerializerException