com.rayrobdod.boardGame

UnidirectionalSpace

final class UnidirectionalSpace[A] extends Space[A]

A com.rayrobdod.boardGame.Space in which a player can continue in only one direction.

A

the type of spaceclass used by this class

Version

3.0.0 rename from UnaryMovement

Linear Supertypes
Space[A], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. UnidirectionalSpace
  2. Space
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new UnidirectionalSpace(typeOfSpace: A, nextSpace: Option[UnidirectionalSpace[A]])

    typeOfSpace

    the class that defines how this space interacts with Tokens.

    nextSpace

    The space a player will continue to after this one

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def adjacentSpaces: Set[UnidirectionalSpace[A]]

    Returns a singleton set containing #nextSpace iff nextSpace is not None; else returns an empty set.

    Returns a singleton set containing #nextSpace iff nextSpace is not None; else returns an empty set.

    Definition Classes
    UnidirectionalSpaceSpace
  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def distanceTo(other: Space[A], costFunction: (Space[_ <: A], Space[_ <: A]) ⇒ Int): Int

    Finds the distance between this Space and another Space.

    Finds the distance between this Space and another Space. This is Dijkstra's algorithm, as the spaces aren't allowed to know where they are in relation they are to each other.

    other

    the space to find the movementCost required to get to

    costFunction

    A function that defines the 'cost' of moving from the first space to the second space

    returns

    the movementCost required to get from this space to other

    Definition Classes
    Space
  10. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  14. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  15. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  16. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  17. val nextSpace: Option[UnidirectionalSpace[A]]

    The space a player will continue to after this one

  18. final def notify(): Unit

    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  20. def pathTo(other: Space[A], costFunction: (Space[_ <: A], Space[_ <: A]) ⇒ Int): List[Space[A]]

    Finds the shortest path from this space to another space This is Dijkstra's algorithm, as the spaces aren't allowed to know where they are in relation they are to each other.

    Finds the shortest path from this space to another space This is Dijkstra's algorithm, as the spaces aren't allowed to know where they are in relation they are to each other.

    This short-circuts when it finds the desired space, and so is more efficient than pathToEverywhere which searches the whole field

    other

    the space to find the movementCost required to get to

    costFunction

    A function that defines the 'cost' of moving from the first space to the second space

    returns

    the a list of spaces such that the first space is this, the last space is other, and the movementcost between the two is minimal

    Definition Classes
    Space
  21. def rawDijkstraData(costFunction: (Space[_ <: A], Space[_ <: A]) ⇒ Int): Map[Space[A], (Int, Space[A])]

    Returns the raw Dijkstra's algorithm data

    Returns the raw Dijkstra's algorithm data

    costFunction

    the function defining the cost to move from one space to another

    returns

    A map where the key is a space, and the value is the cost from here to the key, and how to get there.

    Definition Classes
    Space
  22. def spaceAfter(availableCost: Int, costFunction: (Space[_ <: A], Space[_ <: A]) ⇒ Int): Option[UnidirectionalSpace[_]]

    Returns the space a player will reach when using a certain cost.

    Returns the space a player will reach when using a certain cost.

    availableCost

    the available for movement

    costFunction

    A function that defines the 'cost' of moving from the first space to the second space

    returns

    an Option containing a space if there are nextSpaces until the cost is used up.

    Exceptions thrown
    ClassCastException

    if one of the next spaces is not an instance of UnaryMovement, which presumably means there are multiple available adjacentSpaces.

  23. def spacesAfter(availableCost: Int, costFunction: (Space[_ <: A], Space[_ <: A]) ⇒ Int): Set[Space[A]]

    Finds all the spaces that take exactly movementCost to get To.

    Finds all the spaces that take exactly movementCost to get To.

    availableCost

    the amount of movementCost available

    costFunction

    A function that defines the 'cost' of moving from the first space to the second space

    returns

    a set of all spaces that can be reached from this by moving into an adjacentTile using exactly movementCost

    Definition Classes
    Space
  24. def spacesWithin(availableCost: Int, costFunction: (Space[_ <: A], Space[_ <: A]) ⇒ Int): Set[Space[A]]

    Finds all the spaces within a certain movementCost of this one.

    Finds all the spaces within a certain movementCost of this one.

    availableCost

    the amount of movementCost available

    costFunction

    A function that defines the 'cost' of moving from the first space to the second space

    returns

    a set of all spaces that can be reached from this by moving into an adjacentTile using movementCost or less

    Definition Classes
    Space
  25. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  26. def toString(): String

    Definition Classes
    AnyRef → Any
  27. val typeOfSpace: A

    the class that defines how this space interacts with Tokens.

    the class that defines how this space interacts with Tokens.

    Definition Classes
    UnidirectionalSpaceSpace
  28. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Space[A]

Inherited from AnyRef

Inherited from Any

Ungrouped