com.rayrobdod.boardGame

RectangularSpace

trait RectangularSpace[A] extends Space[A]

A com.rayrobdod.boardGame.Space in a rectangular board, such that it can have zero or one bordering space in each of the four cardinal directions.

Ecludian geometery says that this.left.right == this and this.up.down == this, similarly for each other direction, but this makes no specific checks to that effect.

A

the type of spaceclass used by this class

Version

3.0.0

See also

com.rayrobdod.boardGame.RectangularField

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

Abstract Value Members

  1. abstract def down: Option[Space[A]]

    The space that is located to the down of this space, whatever 'down' means

  2. abstract def left: Option[Space[A]]

    The space that is located to the left of this space, whatever 'left' means

  3. abstract def right: Option[Space[A]]

    The space that is located to the right of this space, whatever 'right' means

  4. abstract def typeOfSpace: A

    an object that defines how this space interacts with tokens

    an object that defines how this space interacts with tokens

    Definition Classes
    Space
  5. abstract def up: Option[Space[A]]

    The space that is located to the up of this space, whatever 'up' means

Concrete 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[_ <: Space[A]]

    the union of this.left, this.up, this.right, this.down

    the union of this.left, this.up, this.right, this.down

    Definition Classes
    RectangularSpaceSpace
  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. final def notify(): Unit

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

    Definition Classes
    AnyRef
  19. 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
  20. 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
  21. 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
  22. 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
  23. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  24. def toString(): String

    Definition Classes
    AnyRef → Any
  25. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Space[A]

Inherited from AnyRef

Inherited from Any

Ungrouped