Back to index

supertuxkart  0.5+dfsg1
player.hpp
Go to the documentation of this file.
00001 // $Id: player.hpp 2111 2008-05-31 07:04:30Z cosmosninja $
00002 //
00003 //  SuperTuxKart - a fun racing game with go-kart
00004 //  Copyright (C) 2006 SuperTuxKart-Team
00005 //
00006 //  This program is free software; you can redistribute it and/or
00007 //  modify it under the terms of the GNU General Public License
00008 //  as published by the Free Software Foundation; either version 2
00009 //  of the License, or (at your option) any later version.
00010 //
00011 //  This program is distributed in the hope that it will be useful,
00012 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 //  GNU General Public License for more details.
00015 //
00016 //  You should have received a copy of the GNU General Public License
00017 //  along with this program; if not, write to the Free Software
00018 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00019 
00020 #ifndef TUXKART_PLAYER_H
00021 #define TUXKART_PLAYER_H
00022 
00023 #include <string>
00024 #include "input.hpp"
00025 
00026 extern const char *sKartAction2String[KA_LAST+1];
00027 
00028 /*class for managing player name and control configuration*/
00029 class Player
00030 {
00031 private:
00032     std::string m_name;
00033     Input m_action_map[KA_LAST+1];
00034     int m_last_kart_id;
00035 
00036 public:
00037     Player(){}
00038     Player(const std::string &name_):m_name(name_),m_last_kart_id(-1){}
00039     void setName(const std::string &name_){m_name = name_;}
00040 
00041     std::string getName() {return m_name;}
00042 
00043     int getLastKartId(){ return m_last_kart_id; }
00044     void setLastKartId(int newLastKartId){ m_last_kart_id = newLastKartId; }
00045 };
00046 
00047 #endif
00048 
00049 /*EOF*/