Class LocationEntry

java.lang.Object
me.therealkeyis.models.LocationEntry

public class LocationEntry extends Object
A database location entry
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    The name of the voice channel for the location
    double
    The x value for the first corner selected
    double
    The x value for the second corner selected
    double
    The z value for the first corner selected
    double
    The z value for the second corner selected
  • Constructor Summary

    Constructors
    Constructor
    Description
    LocationEntry(String locationName, double x1, double z1, double x2, double z2)
    Creation of entry using raw coordinates
    LocationEntry(String locationName, LocationPair coord1, LocationPair coord2)
    Creation of entry using two pairs of coordinates
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    IsBetween(double playerx, double playerz)
    Checks if the provided coordinates are inside this location
    boolean
    IsSurrounding(LocationPair playerLocation)
    Checks if the provided location pair is inside this location

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • locationName

      public String locationName
      The name of the voice channel for the location
    • x1

      public double x1
      The x value for the first corner selected
    • x2

      public double x2
      The x value for the second corner selected
    • z1

      public double z1
      The z value for the first corner selected
    • z2

      public double z2
      The z value for the second corner selected
  • Constructor Details

    • LocationEntry

      public LocationEntry(String locationName, LocationPair coord1, LocationPair coord2)
      Creation of entry using two pairs of coordinates
      Parameters:
      locationName - The name of the voice channel
      coord1 - The first pair of coordinates
      coord2 - The second pair of coordinates
    • LocationEntry

      public LocationEntry(String locationName, double x1, double z1, double x2, double z2)
      Creation of entry using raw coordinates
      Parameters:
      locationName - The name of the voice channel
      x1 - The first x coordinate
      z1 - The first z coordinate
      x2 - The second x coordinate
      z2 - The second z coordinate
  • Method Details

    • IsBetween

      public boolean IsBetween(double playerx, double playerz)
      Checks if the provided coordinates are inside this location
      Parameters:
      playerx - The player's x coordinate
      playerz - The player's z coordinate
      Returns:
      True if inside, false otherwise
    • IsSurrounding

      public boolean IsSurrounding(LocationPair playerLocation)
      Checks if the provided location pair is inside this location
      Parameters:
      playerLocation - The player's current location
      Returns:
      True if inside, false otherwise