/***************************************************************************
 *   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 GILLOPLAYER_H
#define GILLOPLAYER_H

#include "main.h"
#include "entity.h"

namespace gillo {

/**
Hey, this is a player!

@author $AUTHOR$
*/
class Player{
	class Keys {
		public:
			int left;
			int right;
			int up;
			int down;
			int fire;
			int jump;
	};	
	
	Entity*	ePtr;
	int	car;
	
	void handleKeyDown( SDL_keysym* keysym );
	void handleKeyUp  ( SDL_keysym* keysym );
	void initKeys();
	
public:
    Player(Entity& e);
    Player();

    ~Player();
	
	Keys	keys;
	Keys	keysStatus;

	void react(SDL_Event *event);
	inline Entity* getEntityPtr() { return ePtr; }
	inline Entity* setEntity(Entity& e) { return (this->ePtr = &e); }
	inline void releaseEntity() { this->ePtr = NULL; }
	inline void setCar(int c) { this->car = c; }
	inline int  getCar() { return this->car; }
};

};

#endif
