/*
 * Created on Dec 8, 2004
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package WheelOfFortune.game;


import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.Vector;

import WheelOfFortune.game.player.Player;
import WheelOfFortune.game.wheel.Wheel;

/**
 * @author caih
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class OptionModel implements Serializable{
	private Player[] p;
	private int numRounds;
	private Wheel curWheel;
	public static final String OPTFILE = "WheelOfFortune\\game\\options.wof";
	private static FileOutputStream fos;
	private static ObjectOutputStream oos;
	public OptionModel() 
	{
		try{
			curWheel = new Wheel(WheelSetupPanel.wheelString, 12);
		}
		catch(Exception e){}
		p = new Player[3];
		
	}
	/**
	 * @return Returns the curWheel.
	 */
	public Wheel getCurWheel() {
		return curWheel;
	}
	/**
	 * @param curWheel The curWheel to set.
	 */
	public void setCurWheel(Wheel curWheelParam) {
		try{
		this.curWheel = new Wheel(curWheelParam,12);
		}
		catch(Exception e){}
	}
	/**
	 * @return Returns the numRounds.
	 */
	public int getNumRounds() {
		return numRounds;
	}
	/**
	 * @param numRounds The numRounds to set.
	 */
	public void setNumRounds(int numRounds) {
		this.numRounds = numRounds;
	}
	/**
	 * @return Returns the p.
	 */
	public Player[] getP() {
		return p;
	}
	/**
	 * @param p The p to set.
	 */
	public void setP(Player[] p) {
		this.p = p;
	}
	public void save() throws IOException
	{
		fos = new FileOutputStream(OPTFILE);
		oos = new ObjectOutputStream(fos);
		
		oos.writeObject(this);
		
	}
}
