title: Creating a player class that can be used by two different games
body: <p>I have to write some classes for snakes and ladders and tic tac toe.</p>
  
  <p>I am trying to create a Player class which is the super class of <code>Player_Piece</code> and <code>Player_Symbol</code>.</p>
  
  <p>Player class has to: Create the player objects, stores the player object <code>states:Name</code>,<code>Score</code>.</p>
  
  <p><code>Player_Piece</code> has to assign the color and position to the objects which is the player piece on the game board of snakes and ladders. It also has to move the pieces </p>
  
  <p><code>Player_Symbol</code> is the class for the tic tac toe game it assigns and holds the  players symbol, (either a nought or a cross) and positions.</p>
  
  <p>I am not sure if I have done these classes correctly and I would appreciate some advice on anything I should change. I am very new to java and I have been thrown into the deep end with this </p>
  
  <p>Player Class</p>
  
  <pre><code>public class Player {
  
      private String PlayerName;
  
      public Player(String name) {
          PlayerName = name;
      }
  
      /**
       * This set method sets the name of the player.
       * 
       *  @param Takes in a String as name.
       */
      public void setName(String name) {
          this.PlayerName = name;
      }
  
      /**
       * This get method returns the String value of player name.
       * 
       *  @return PlayerName, a String value.
       */
      public String getName() {
          return PlayerName;
      }
  
  }
  </code></pre>
  
  <p>Player_Piece Class</p>
  
  <pre><code>public class Player_Piece extends Player {
      // class constants
      // Colors for the players piece 
      public static final String BLUE = "Blue";
      public static final String RED = "red";
      public static final String YELLOW = "Yellow";
      public static final String BLACK = "Black";
  
      // Types for each players piece. 
      public static final String PLAYER1PIECE = "player one's piece";
      public static final String PLAYER2PIECE = "player two's piece";
      public static final String PLAYER3PIECE = "player three's piece";
      public static final String PLAYER4PIECE = "player four's piece";
  
  
      // fields
      private String color;
      private String type;
      private int row;
      private int column;
  
      // constructors
      /**
       * Constructs a new player piece with a colour and type at the given position.
       * @param color  The piece's color must be one of the following: BLUE, RED, YELLOW or BLACK.
       * @param type   The piece's type must either PLAYER1PIECE, PLAYER2PIECE, PLAYER3PIECE, PLAYER4PIECE.
       */
      public Player_Piece(String color, String type, int row, int column) {
  
  
          this.color  = color;
          this.type   = type;
          this.row    = row;
          this.column = column;
  
      }
  
      // methods for the class
      /**
       * Returns this players piece color. 
       * @return the color; either BLUE, RED, YELLOW or BLACK.
       */
      public String getColor() {
          return this.color;
      }
  
      /**
       * Returns this player piece's type.
       * @return the type; either PLAYER1PIECE, PLAYER2PIECE, PLAYER3PIECE, PLAYER4PIECE.
       */
      public String getType() {
          return this.type;
      }
  
      /**
       * Returns this player's piece row position.
       * @return the position of the piece.
       */
      public int getRow() {
          return this.row;
      }
  
      /**
       * Returns this player's piece column position.
       * @return the  position of the piece at the column
       */
      public int getColumn() {
          return this.column;
      }
  
      /**
       * Returns a String  of this piece.
       * @return a three letter String, such as "P1P" for player one's piece.
       */
      public String toString() {
          return this.type.substring(0, 1);
      }
  
      /**
       * Moves the piece to the  position.
       * 
       * @param row The row position for the piece to move to.
       * @param column The column position for the piece to move to.
       */
      public void move(int row, int column) {
          this.row    = row;
          this.column = column;
  
  
        }
  }
  </code></pre>
  
  <p>Player_Symbol Class </p>
  
  <pre><code>public class Player_Symbol extends player {
  
      private String symbolChoice;
      private int[][] symbolPosition;
  
      public void setSymbol (String symbol) {
          this.symbolChoice = symbol;
      }
  
      public void setSymbolPos(int[][] position) {
          this.symbolPosition = position;
      }
  
      public String getSymbol() {
          return symbolChoice;
      }
  
      public int[][] getSymbolPos() {
          return symbolPosition;
      }
  
  }
  </code></pre>