/***************************************************************************
 *   Copyright (C) 2004-2005 by                                            *
 *     Paolo Sacconier   <axa1981@tin.it>                                  *
 *     Francesco Tamagni <minchiahead@hacari.org>                          *
 *                                                                         *
 *   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.             *
 ***************************************************************************/
#ifndef GILLORECT_H
#define GILLORECT_H

#include "main.h"

namespace gillo {

class Rect {
	protected:    
		float alpha;
		sgVec2 coords[4];
		Rect();
        
	public:
		virtual ~Rect();
		virtual void draw() = 0; 
		void setCoords(float x1, float y1, float x2, float y2);
		void setCoords(float coords[4]);
		void setPos(float x, float y);
		void traslate(float dx, float dy);
		inline float getPosX() { return coords[0][0]; }
		inline float getWidth() { return coords[2][0] -coords[0][0]; }
		inline float getHeight() { return coords[2][1] -coords[0][1]; }
		inline void setWidth(float newWidth) { coords[1][0] = coords[0][0] +newWidth; coords[2][0] = coords[3][0] +newWidth; }
		inline void setHeight(float newHeight) { coords[2][1] = coords[0][1] +newHeight; coords[3][1] = coords[1][1] +newHeight; }
		inline void setAlpha(float alpha) { this->alpha = alpha; }
};

}

#endif
