package com.tootsville.tootsbook.client.util;


/**
 * @author twheys@gmail.com
 */
public class UserProfile extends ShadowUser {

	/**
	 * WRITEME twheys@gmail.com
	 */
	private String avatarResource = "default";

	/**
	 * WRITEME twheys@gmail.com
	 */
	int basicEight = 1;

	/**
	 * WRITEME twheys@gmail.com
	 */
	private String boxColorResource = "default";

	/**
	 * WRITEME twheys@gmail.com
	 */
	private ShadowUser [] buddies = {};
	/**
	 * WRITEME twheys@gmail.com
	 */
	boolean isPaid = false;

	/**
	 * WRITEME twheys@gmail.com
	 */
	private String pageResource = "default";

	/**
	 * WRITEME twheys@gmail.com
	 */
	private int peanuts;

	/**
	 * WRITEME twheys@gmail.com
	 */
	private int staffLevel = 0;

	/**
	 * The status of this user.
	 */
	private String status = "I haven't though of anything to put here yet.";

	/**
	 * WRITEME twheys@gmail.com
	 */
	private String titleResource = "default";

	/**
	 * default constructor, creates an empty object
	 */
	public UserProfile () {
		// do nothing
	}

	/**
	 * @return the url to the background image for this user.
	 */
	public String getAvatarBgURL () {
		return ShadowUser.getAvatarBgURLForItemID (avatarResource);
	}
	
	/**
	 * <pre>
	 * twheys@gmail.com Jan 19, 2010
	 * </pre>
	 * 
	 * TO getBasicEight WRITEME...
	 * 
	 * @return WRITEME twheys@gmail.com
	 */
	public int getBasicEight () {
		// default getter (twheys@gmail.com, Oct 29, 2009)
		return basicEight;
	}

	/**
	 * @return The url to the box stylesheet
	 */
	public String getBoxStyleURL () {
		// default getter (twheys@gmail.com, Oct 22, 2009)
		return ShadowUser.getBoxStyleURLForItemID (boxColorResource);
	}

	/**
	 * @return an array of {@link ShadowUser} that represent this user's buddy
	 *         list
	 */
	public ShadowUser [] getBuddies () {
		ShadowUser [] result = new ShadowUser [buddies.length];
        for (int i = 0; i < buddies.length; i++ ) {
            result [i] = buddies [i];
        }
        return result;
	}
	
	/**
	 * returns the relative URL for root for Box accent icons
	 * 
	 * @return The relative URL for root for Box accent icons
	 */
	public String getIconBaseURL () {
		return "/tootbook-resource/themes/box-styles/"
				+ boxColorResource + "/";
	}
	
	/**
	 * returns relative URL for theme
	 * 
	 * @return The relative URL for root for Page style sheet
	 */
	public String getPageStyleURL () {
		return ShadowUser.getPageStyleURLForItemID (pageResource);
	}
	
	/**
	 * <pre>
	 * twheys@gmail.com Mar 1, 2010
	 * </pre>
	 * 
	 * TO getPeanuts WRITEME...
	 * 
	 * @return WRITEME twheys@gmail.com
	 */
	public int getPeanuts () {
		return peanuts;
	}

	/**
	 * @return the staffLevel
	 */
	public int getStaffLevel () {
		return staffLevel;
	}

	/**
	 * @return the status
	 */
	public String getStatus () {
		return status;
	}
	
	/**
	 * returns relative URL for theme
	 * 
	 * @return the style sheet for the background of the title box.
	 */
	public String getTitleStyleURL () {
		return ShadowUser.getTitleStyleURLForItemID (titleResource);
	}
	
	/**
	 * <pre>
	 * twheys@gmail.com Jan 19, 2010
	 * </pre>
	 * 
	 * TO isPaid WRITEME...
	 * 
	 * @return WRITEME twheys@gmail.com
	 */
	public boolean isPaid () {
		// default getter (twheys@gmail.com, Oct 29, 2009)
		return isPaid;
	}

	/**
	 * @param newAvatarResource the avatarResource to set
	 */
	public void setAvatarResource (final String newAvatarResource) {
		avatarResource = newAvatarResource;
	}

	/**
	 * @param newBasicEight the basicEight to set
	 */
	public void setBasicEight (final int newBasicEight) {
		basicEight = newBasicEight;
	}

	/**
	 * @param newBoxColorResource the boxColorResource to set
	 */
	public void setBoxColorResource (final String newBoxColorResource) {
		boxColorResource = newBoxColorResource;
	}
	
	/**
	 * <pre>
	 * twheys@gmail.com Jan 19, 2010
	 * </pre>
	 * 
	 * TO setBuddies WRITEME...
	 * 
	 * @param newBuddies WRITEME twheys@gmail.com
	 */
	public void setBuddies (final ShadowUser [] newBuddies) {
		buddies = new ShadowUser [newBuddies.length];
        for (int i = 0; i < newBuddies.length; i++ ) {
            buddies [i] = newBuddies [i];
        }
	}

	/**
	 * @param newPageResource the pageResource to set
	 */
	public void setPageResource (final String newPageResource) {
		pageResource = newPageResource;
	}

	/**
	 * @param newPaid the isPaid to set
	 */
	public void setPaid (final boolean newPaid) {
		isPaid = newPaid;
	}
	
	/**
	 * <pre>
	 * twheys@gmail.com Mar 1, 2010
	 * </pre>
	 * 
	 * TO setPeanuts WRITEME...
	 * 
	 * @param newPeanuts WRITEME twheys@gmail.com
	 */
	public void setPeanuts (final int newPeanuts) {
		peanuts = newPeanuts;
	}

	/**
	 * @param newStaffLevel the staffLevel to set
	 */
	public void setStaffLevel (final int newStaffLevel) {
		staffLevel = newStaffLevel;
	}

	/**
	 * @param newStatus the status to set
	 */
	public void setStatus (final String newStatus) {
		status = newStatus;
	}

	/**
	 * @param newTitleResource the titleResource to set
	 */
	public void setTitleResource (final String newTitleResource) {
		titleResource = newTitleResource;
	}
	
	/**
	 * <pre>
	 * twheys@gmail.com Mar 1, 2010
	 * </pre>
	 * 
	 * TO subtractPeanuts WRITEME...
	 * 
	 * @param itemPrice WRITEME twheys@gmail.com
	 */
	public void subtractPeanuts (final int itemPrice) {
		peanuts -= itemPrice;
	}
}
