Class Stone

  • All Implemented Interfaces:
    IStone

    public class Stone
    extends java.lang.Object
    implements IStone
    This class contains information about the stones characteristics and behaviour
    Author:
    Gruppe 175: Moritz Henseleit, Rubn Meyer
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.awt.Color color
      The stones color according to the stones type
      private Position position
      The stones position on the playground
      private int type
      The stones type
      private int value
      The stones value according to the stones type to calculate players score
    • Constructor Summary

      Constructors 
      Constructor Description
      Stone​(int type, Position position)
      The constructor of a stone
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.awt.Color getColor()
      The getter for the stones color Can be null because a stone could not exist
      Position getPosition()
      The getter for the stones position
      int getType()
      The getter for the stones type
      int getValue()
      The getter for the stones value to calculate players score
      void setColor​(java.awt.Color color)
      The setter for the stones color
      void setPosition​(Position position)
      The setter for the stones position
      void setType​(int type)
      The setter for the stones type
      void setValue​(int value)
      The setter for the stones value
      • Methods inherited from class java.lang.Object

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

      • type

        private int type
        The stones type
      • value

        private int value
        The stones value according to the stones type to calculate players score
      • color

        private java.awt.Color color
        The stones color according to the stones type
      • position

        private Position position
        The stones position on the playground
    • Constructor Detail

      • Stone

        public Stone​(int type,
                     Position position)
        The constructor of a stone
        Parameters:
        type - stones initial type
        position - stones initial position
    • Method Detail

      • getValue

        public int getValue()
        The getter for the stones value to calculate players score
        Specified by:
        getValue in interface IStone
        Returns:
        stones value
      • setValue

        public void setValue​(int value)
        The setter for the stones value
        Specified by:
        setValue in interface IStone
        Parameters:
        value - The stones new value
      • getColor

        public java.awt.Color getColor()
        The getter for the stones color Can be null because a stone could not exist
        Specified by:
        getColor in interface IStone
        Returns:
        The stones color
      • setColor

        public void setColor​(java.awt.Color color)
        The setter for the stones color
        Specified by:
        setColor in interface IStone
        Parameters:
        color - The stones new color
      • getPosition

        public Position getPosition()
        The getter for the stones position
        Specified by:
        getPosition in interface IStone
        Returns:
        The stones position
      • setPosition

        public void setPosition​(Position position)
        The setter for the stones position
        Specified by:
        setPosition in interface IStone
        Parameters:
        position - The stones new position
      • getType

        public int getType()
        The getter for the stones type
        Specified by:
        getType in interface IStone
        Returns:
        The stones type
      • setType

        public void setType​(int type)
        The setter for the stones type
        Specified by:
        setType in interface IStone
        Parameters:
        type - The stones new type