com.rayrobdod.boardGame

Space

abstract class Space extends AnyRef

A spot on a board game board

Version

2013 Aug 20 - using minBy instead of custom comparators

See also

com.rayrobdod.boardGame.SpaceClass defines the way this interacts with tokens

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

Instance Constructors

  1. new Space(typeOfSpace: SpaceClass)

    typeOfSpace

    the class that defines how this space interacts with Tokens.

Abstract Value Members

  1. abstract def adjacentSpaces: Traversable[Space]

    A space that is treated as adjacent to this one; such as a tile that can be directly accessed from this tile without passing through other tiles

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

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def distanceTo(other: Space, token: Token, costType: TypeOfCost): 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

    returns

    the movementCost required to get from this space to other

  9. final def eq(arg0: AnyRef): Boolean

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

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

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

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

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

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

    Definition Classes
    AnyRef
  16. final def notify(): Unit

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

    Definition Classes
    AnyRef
  18. def pathTo(other: Space, token: Token, costType: TypeOfCost): List[Space]

    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

    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

  19. def pathToEverywhere(token: Token, costType: TypeOfCost): Map[Space, (Int, Space)]

    Returns the raw Dijkstra's algorithm data

    Returns the raw Dijkstra's algorithm data

    token

    the token that is moving from this space to everywhere

    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.

  20. def spacesAfter(availableCost: Int, token: Token, costType: TypeOfCost): Set[Space]

    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

    returns

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

  21. def spacesWithin(availableCost: Int, token: Token, costType: TypeOfCost): Set[Space]

    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

    returns

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

  22. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  23. def toString(): String

    Definition Classes
    AnyRef → Any
  24. val typeOfSpace: SpaceClass

    the class that defines how this space interacts with Tokens.

  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 AnyRef

Inherited from Any

Ungrouped