game-client

Play TicTacToe and Reversi
Log | Files | Refs

Player.java (1058B)


      1 package nl.isygameclient.models;
      2 
      3 import nl.isygameclient.util.Vector2D;
      4 
      5 public abstract class Player {
      6 
      7     protected Game game;
      8     protected String playerName;
      9     protected String playingAs;
     10 
     11     public Player(String playerName, String playingAs) {
     12         this.playerName = playerName;
     13         this.playingAs = playingAs;
     14     }
     15 
     16     public abstract Vector2D<Integer, Integer> onPlayerTurn();
     17 
     18     public Game getGame() {
     19         return game;
     20     }
     21 
     22     public void setGame(Game game) {
     23         this.game = game;
     24     }
     25 
     26     public String getPlayerName() {
     27         return playerName;
     28     }
     29 
     30     public void setPlayerName(String playerName) {
     31         this.playerName = playerName;
     32     }
     33 
     34     public String getPlayingAs() {
     35         return playingAs;
     36     }
     37 
     38     public void setPlayingAs(String playingAs) {
     39         this.playingAs = playingAs;
     40     }
     41 
     42     @Override
     43     public String toString() {
     44         return "Player{" +
     45                 "playerName='" + playerName + '\'' +
     46                 ", playingAs='" + playingAs + '\'' +
     47                 '}';
     48     }
     49 }