package WheelOfFortune.game.player;

import java.io.Serializable;
// Source file: U:\\cse308\\asn8\\src\\game\\player\\Player.java


public class Player implements Serializable{
 private String name;
 private int roundMoney;
 private int totalMoney;
 private int freeSpin;
 private int fiftyFifty;
 private int difficulty;
 private int character;
 private String imagePath;
 private StrategyPolicy stratPolicy;
 private CPUPlayerStrategy strategy;
 public static final int HUMAN_PLAYER = -1;
 public static final int EASY_CPU_PLAYER = 1;
 public static final int NORMAL_CPU_PLAYER = 2;
 public static final int HARD_CPU_PLAYER = 3;
   
 /**
  * @param name
  * @roseuid 41892E1D039E
  */
 public Player(String name, int difficulty, int character, String imagePath) {
  this.name = name;
  this.character = character;
  this.imagePath = imagePath;
  roundMoney = 0;
  totalMoney = 0;
  freeSpin = 0;
  fiftyFifty = 0;
  this.difficulty = difficulty;
  stratPolicy = null;
  strategy = null;
 }
   
 public String getImagePath()
 {
 	return imagePath;
 }
 
 /**
  * @return String
  * @roseuid 41892E2301DA
  */
 public String getName() {
  return name;
 }


   
/**
 * @return Returns the character.
 */
public int getCharacter() {
	return character;
}
/**
 * @param character The character to set.
 */
public void setCharacter(int character) {
	this.character = character;
}
 /**
  * @return int
  * @roseuid 41892E2E0317
  */
 public int getRoundMoney() {
  return roundMoney;
 }
   
 /**
  * @param money
  * @roseuid 41892E290201
  */
 public void setRoundMoney(int money) {
  if(money >= 0) roundMoney = money;
}

   

   
 /**
  * @return int
  * @roseuid 41892E3B037B
  */
 public int getTotalMoney() {
  return totalMoney;
 }

 /**
  * @param money
  * @roseuid 41892E35003D
  */
 public void setTotalMoney(int money) {
    if(money >= 0) totalMoney = money;
 }

 /**
  * @return int
  * @roseuid 41892E4603BD
  */
 public int getFreeSpin() {
  return freeSpin;
 }
   
 /**
  * @param frees
  * @roseuid 41892E41003A
  */
 public void setFreeSpin(int frees) {
  if(frees >= 0) freeSpin = frees;
}

 /**
  * @return int
  * @roseuid 41892E5701BA
  */
 public int getFiftyFifty() {
  return fiftyFifty;
 }
   

   
 /**
  * @param fiftyfif
  * @roseuid 41892E500029
  */
 public void setFiftyFifty(int fiftyFifty) {
  if(fiftyFifty >=0) this.fiftyFifty = fiftyFifty;
 }
   

   
 /**
  * @return int
  * @roseuid 41892E5E02B4
  */
 public int getDifficulty() {
  return difficulty;
 }
   
 /**
  * @param diff
  * @roseuid 41892E640263
  */
 public void setDifficulty(int diff) {
  if(diff >= -1) difficulty = diff; //can be -1 for human player
 }
   
 /**
  * @return CPUPlayerStrategy
  * @roseuid 41892E6C0215
  */
 public CPUPlayerStrategy getStrategy() {
  StrategyPolicy sp = new StrategyPolicy();
  return sp.getStrategy(difficulty);
 }

 //for debugging
 public String toString() {
  return "Name: " + name
  + "\nRoundMoney: " + roundMoney
  + "\nTotalMoney: " + totalMoney
  + "\nFreeSpin: " + freeSpin
  + "\nFiftyFifty: " + fiftyFifty
  + "\nDifficulty: " + difficulty;
 }
 public boolean isCPU()
 {
 	if(difficulty < 1)
 		return false;
 	return true;
 }
}
