Trait

com.rayrobdod.boardGame

RectangularSpace

Related Doc: package boardGame

Permalink

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

Source
RectangularSpace.scala
Version

3.0.0

See also

com.rayrobdod.boardGame.RectangularField

Linear Supertypes
Known Subclasses
Type Hierarchy Learn more about scaladoc diagrams
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. RectangularSpace
  2. Space
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Abstract Value Members

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

    Permalink

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

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

    Permalink

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

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

    Permalink

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

  4. abstract def typeOfSpace: A

    Permalink

    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]]

    Permalink

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

Concrete Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. def adjacentSpaces: Set[_ <: Space[A]]

    Permalink

    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
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def distanceTo(other: Space[A], costFunction: CostFunction[A]): Int

    Permalink

    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
  8. final def eq(arg0: AnyRef): Boolean

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

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. def pathTo(other: Space[A], costFunction: CostFunction[A]): List[Space[A]]

    Permalink

    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
  18. def rawDijkstraData(costFunction: CostFunction[A]): Map[Space[A], (Int, Space[A])]

    Permalink

    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
  19. def spacesAfter(availableCost: Int, costFunction: CostFunction[A]): Set[Space[A]]

    Permalink

    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
  20. def spacesWithin(availableCost: Int, costFunction: CostFunction[A]): Set[Space[A]]

    Permalink

    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
  21. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  22. def toString(): String

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Space[A]

Inherited from AnyRef

Inherited from Any

Ungrouped