Class PathPair

java.lang.Object
net.royalur.model.path.PathPair
Direct Known Subclasses:
AsebPathPair, BellPathPair, MastersPathPair, MurrayPathPair, SkiriukPathPair

public class PathPair extends Object
Represents a pair of paths for the light and dark players to move their pieces along in a game of the Royal Game of Ur.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PathPair(String id, List<Tile> lightWithStartEnd, List<Tile> darkWithStartEnd)
    Instantiates a pair of paths.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    get(PlayerType player)
    Gets the path of player, excluding the start and end tiles that exist off the board.
    Gets the path that the dark player's pieces must take, excluding the start and end tiles that exist off the board.
    Gets the end tile for the dark player that exists off the board.
    Gets the start tile for the dark player that exists off the board.
    Gets the path that the dark player's pieces must take, including the start and end tiles that exist off the board.
    Gets the end tile of player that exists off the board.
    Gets the ID of this path pair.
    Gets the path that the light player's pieces must take, excluding the start and end tiles that exist off the board.
    Gets the end tile for the light player that exists off the board.
    Gets the start tile for the light player that exists off the board.
    Gets the path that the light player's pieces must take, including the start and end tiles that exist off the board.
    Gets the name of this path.
    Gets the type of this path.
    Gets the start tile of player, which exists off the board.
    Gets the path of player, including the start and end tiles that exist off the board.
    boolean
    Gets whether this path has an associated path type.
    boolean
    Determines whether the paths that the light player's pieces must take, and the paths that the dark player's pieces must take, are equivalent between this path pair and other.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PathPair

      public PathPair(String id, List<Tile> lightWithStartEnd, List<Tile> darkWithStartEnd)
      Instantiates a pair of paths.
      Parameters:
      id - The ID of this path.
      lightWithStartEnd - The path that light players take around the board, including the start and end tiles that exist off the board.
      darkWithStartEnd - The path that dark players take around the board, including the start and end tiles that exist off the board.
  • Method Details

    • getID

      public String getID()
      Gets the ID of this path pair.
      Returns:
      The ID of this path pair.
    • hasPathType

      public boolean hasPathType()
      Gets whether this path has an associated path type. Custom path may not have an associated path type.
      Returns:
      Whether this path has an associated path type.
    • getPathType

      public PathType getPathType()
      Gets the type of this path.
      Returns:
      The type of this path.
    • getName

      public String getName()
      Gets the name of this path.
      Returns:
      The name of this path.
    • getLight

      public List<Tile> getLight()
      Gets the path that the light player's pieces must take, excluding the start and end tiles that exist off the board.
      Returns:
      The path that the light player's pieces must take on the board.
    • getDark

      public List<Tile> getDark()
      Gets the path that the dark player's pieces must take, excluding the start and end tiles that exist off the board.
      Returns:
      The path that the dark player's pieces must take on the board.
    • get

      public List<Tile> get(PlayerType player)
      Gets the path of player, excluding the start and end tiles that exist off the board.
      Parameters:
      player - The player to get the path for.
      Returns:
      The path for the given player.
    • getLightWithStartEnd

      public List<Tile> getLightWithStartEnd()
      Gets the path that the light player's pieces must take, including the start and end tiles that exist off the board.
      Returns:
      The path that the light player's pieces must take on and off the board.
    • getDarkWithStartEnd

      public List<Tile> getDarkWithStartEnd()
      Gets the path that the dark player's pieces must take, including the start and end tiles that exist off the board.
      Returns:
      The path that the dark player's pieces must take on and off the board.
    • getWithStartEnd

      public List<Tile> getWithStartEnd(PlayerType player)
      Gets the path of player, including the start and end tiles that exist off the board.
      Parameters:
      player - The player to get the path for.
      Returns:
      The path for the given player.
    • getLightStart

      public Tile getLightStart()
      Gets the start tile for the light player that exists off the board.
      Returns:
      The start tile for the light player.
    • getDarkStart

      public Tile getDarkStart()
      Gets the start tile for the dark player that exists off the board.
      Returns:
      The start tile for the dark player.
    • getStart

      public Tile getStart(PlayerType player)
      Gets the start tile of player, which exists off the board.
      Parameters:
      player - The player to get the start tile for.
      Returns:
      The start tile of the given player.
    • getLightEnd

      public Tile getLightEnd()
      Gets the end tile for the light player that exists off the board.
      Returns:
      The end tile for the light player.
    • getDarkEnd

      public Tile getDarkEnd()
      Gets the end tile for the dark player that exists off the board.
      Returns:
      The end tile for the dark player.
    • getEnd

      public Tile getEnd(PlayerType player)
      Gets the end tile of player that exists off the board.
      Parameters:
      player - The player to get the end tile for.
      Returns:
      The end tile of the given player.
    • isEquivalent

      public boolean isEquivalent(PathPair other)
      Determines whether the paths that the light player's pieces must take, and the paths that the dark player's pieces must take, are equivalent between this path pair and other. The start and end tiles that exist off the board may still differ between the paths.
      Parameters:
      other - The other pair of paths to check for equivalency.
      Returns:
      Whether the paths that the light and dark player's pieces must take around the board are equivalent for this path pair and other.
    • equals

      public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object