Package dev.davwheat

Class BoardSpace

  • Direct Known Subclasses:
    Animal

    public class BoardSpace
    extends java.lang.Object
    A space on the GameBoard which a Player can land on and interact with.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.lang.String displayName
      The name displayed to Players for this Board Space.
      int index
      The position of this BoardSpace on the GameBoard.
      boolean isOwnable
      Whether this BoardSpace can be owned by a Player.
      BoardSpaceType type
      The type of BoardSpace.
    • Constructor Summary

      Constructors 
      Constructor Description
      BoardSpace​(java.lang.String displayName, int index, BoardSpaceType type, boolean isOwnable, Game game)
      Create a new instance of BoardSpace.
    • Method Summary

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • index

        public final int index
        The position of this BoardSpace on the GameBoard.
      • displayName

        public final java.lang.String displayName
        The name displayed to Players for this Board Space.
      • isOwnable

        public final boolean isOwnable
        Whether this BoardSpace can be owned by a Player.
    • Constructor Detail

      • BoardSpace

        public BoardSpace​(java.lang.String displayName,
                          int index,
                          BoardSpaceType type,
                          boolean isOwnable,
                          Game game)
        Create a new instance of BoardSpace.
        Parameters:
        displayName - The name of the BoardSpace shown to the players.
        index - The position of this BoardSpace on the GameBoard.
        type - The type of this BoardSpace.
        isOwnable - Whether this BoardSpace can be owned by a Player.
        game - The Game that this BoardSpace belongs to.