/*
Tiamat - a role-playing game framework
LocationObjectData.java - specifies where an object resides in a location
 
 Copyright  (C) 2006 Hugues Johnson
 
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
the GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

package com.huguesjohnson.tiamat;

/** LocationObjectData - specifies where an object resides in a location
 * @author Hugues Johnson
 */
public class LocationObjectData{

//begin public constants

	/** Specifies the x-alignment of the object. 
	 * <code>public enum XAlignment{ FIXED, CENTER, LEFT, RIGHT }</code>
	 */
	public enum XAlignment{
		  FIXED, //fixed position
		  CENTER, //centered on x-axis
		  LEFT, //align on left side
		  RIGHT //alight on right side
	}
	/** <code>DEFAULT_X_ALIGN=XAlignment.FIXED</code> */
	public final static XAlignment DEFAULT_X_ALIGN=XAlignment.FIXED;
	
	/** Specifies the y-alignment of the object. 
	 * <code>public enum YAlignment{ FIXED, CENTER, TOP, BOTTOM }</code>
	 */
	public enum YAlignment{
		FIXED, //fixed position
		CENTER, //centered on y-axis
		TOP, //align on top
		BOTTOM //alight on bottom
	}
	/** <code>DEFAULT_Y_ALIGN=YAlignment.FIXED</code> */
	public final static YAlignment DEFAULT_Y_ALIGN=YAlignment.FIXED;

	/** <code>boolean DEFAULT_VISIBLE=true</code> */
	public final static boolean DEFAULT_VISIBLE=true;
//end public constants

//begin public properties
	private XAlignment xalign; 
	/**
	 * @return Returns x alignment of the object.
	 */
	public XAlignment getXalign(){
		return(this.xalign);
	}
	/**
	 * @param xalign The x alignment of the object.
	 */
	public void setXalign(XAlignment xalign){
		this.xalign=xalign;
	}
	
	private YAlignment yalign;
	/**
	 * @return Returns the y alignment of the object.
	 */
	public YAlignment getYalign(){
		return(this.yalign);
	}
	/**
	 * @param yalign The y alignment of the object.
	 */
	public void setYalign(YAlignment yalign){
		this.yalign=yalign;
	}

	private int y;
	/**
	 * @return Returns the actual y location of the object.
	 */
	public int getY(){
		return(this.y);
	}
	/**
	 * @param y The actual y location of the object.
	 */
	public void setY(int y){
		this.y=y;
	}
	
	private int x;
	/**
	 * @return Returns the actual x location of the object.
	 */
	public int getX(){
		return(this.x);
	}
	/**
	 * @param x The actual x location of the object.
	 */
	public void setX(int x){
		this.x=x;
	}	
	
	private String name;
	/**
	 * @return Returns the name of the object.
	 */
	public String getName(){
		return(this.name);
	}
	/**
	 * @param name The name of the object.
	 */
	public void setName(String name){
		this.name=new String(name);
	}
	
	private boolean visible;
	/**
	 * @return Returns whether the object is visible.
	 */
	public boolean getVisible(){
		return(this.visible);
	}
	/**
	 * @param visible True if the object is visible.
	 */
	public void setVisible(boolean visible){
		this.visible=visible;
	}
//end public properties

//begin constructors
	/**
	 * Create a new instance of LocationObjectData
	 * @param name The name of the object.
	 */
	public LocationObjectData(String name){
		this.setName(name);
		this.setVisible(DEFAULT_VISIBLE);
		this.setXalign(DEFAULT_X_ALIGN);
		this.setYalign(DEFAULT_Y_ALIGN);
		this.setX(0);
		this.setY(0);
	}
	/**
	 * Create a new instance of LocationObjectData
	 * @param name The name of the object.
	 * @param visible Whether the object is visible.
	 */
	public LocationObjectData(String name,boolean visible){
		this.setName(name);
		this.setVisible(visible);
		this.setXalign(DEFAULT_X_ALIGN);
		this.setYalign(DEFAULT_Y_ALIGN);
		this.setX(0);
		this.setY(0);
	}
	/**
	 * Create a new instance of LocationObjectData
	 * @param name The name of the object.
	 * @param xalign The x alignment of the object.
	 * @param yalign The y alignment of the object.
	 */
	public LocationObjectData(String name,XAlignment xalign,YAlignment yalign){
		this.setName(name);
		this.setVisible(DEFAULT_VISIBLE);
		this.setXalign(xalign);
		this.setYalign(yalign);
		this.setX(0);
		this.setY(0);
	}
	/**
	 * Create a new instance of LocationObjectData
	 * @param name The name of the object.
	 * @param xalign The x alignment of the object.
	 * @param yalign The y alignment of the object.
	 * @param x The actual x location of the object.
	 * @param y The actual y location of the object.
	 */
	public LocationObjectData(String name,XAlignment xalign,YAlignment yalign,int x,int y){
		this.setName(name);
		this.setVisible(DEFAULT_VISIBLE);
		this.setXalign(xalign);
		this.setYalign(yalign);
		this.setX(x);
		this.setY(y);
	}
	/**
	 * Create a new instance of LocationObjectData
	 * @param name The name of the object.
	 * @param visible Whether the object is visible.
	 * @param xalign The x alignment of the object.
	 * @param yalign The y alignment of the object.
	 */
	public LocationObjectData(String name,boolean visible,XAlignment xalign,YAlignment yalign){
		this.setName(name);
		this.setVisible(visible);
		this.setXalign(xalign);
		this.setYalign(yalign);
		this.setX(0);
		this.setY(0);
	}
	/**
	 * Create a new instance of LocationObjectData
	 * @param name The name of the object.
	 * @param visible Whether the object is visible.
	 * @param xalign The x alignment of the object.
	 * @param yalign The y alignment of the object.
	 * @param x The actual x location of the object.
	 * @param y The actual y location of the object.
	 */
	public LocationObjectData(String name,boolean visible,XAlignment xalign,YAlignment yalign,int x,int y){
		this.setName(name);
		this.setVisible(visible);
		this.setXalign(xalign);
		this.setYalign(yalign);
		this.setX(x);
		this.setY(y);
	}
//end constructors
}