00001 //----------------------------------------------------------------------------------- 00002 // 00003 // Pro-Vocation Light Engine (PVLE) 00004 // Copyright (C) 2007-2009 Sukender, KinoX & Buzib 00005 // For more information, contact us : sukender@free.fr 00006 // 00007 // This program is free software; you can redistribute it and/or modify 00008 // it under the terms of the GNU General Public License as published by 00009 // the Free Software Foundation; either version 3 of the License, or 00010 // (at your option) any later version. 00011 // 00012 // For any use that is not compatible with the terms of the GNU 00013 // General Public License, please contact the authors for alternative 00014 // licensing options. 00015 // 00016 // This program is distributed in the hope that it will be useful, 00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 // GNU General Public License for more details. 00020 // 00021 // You should have received a copy of the GNU General Public License along 00022 // with this program; if not, write to the Free Software Foundation, Inc., 00023 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00024 // 00025 //----------------------------------------------------------------------------------- 00026 00027 #ifndef GAME_PVLE_PLAYER_INFO_H 00028 #define GAME_PVLE_PLAYER_INFO_H 00029 00030 #include <PVLE/Config.h> 00031 #include <PVLE/Export.h> 00032 #include <PVLE/Util/Util.h> 00033 #include <PVLE/Input/ControlMapper.h> 00034 #include <osg/Referenced> 00035 #include <string> 00036 #ifdef PVLE_NETWORKING 00037 #include <tnl/tnlCertificate.h> // [Sukender] Needed for DLL compilation, but I don't know why... 00038 #include <tnl/tnlNetObject.h> 00039 #endif 00040 class PVLETeam; 00041 class PVLEGame; 00042 00046 #ifdef PVLE_NETWORKING 00047 class PVLE_EXPORT PVLEPlayer : public osg::Referenced, public TNL::NetObject { 00048 #else 00049 class PVLE_EXPORT PVLEPlayer : public osg::Referenced { 00050 #endif 00051 public: 00052 PVLEPlayer() : pTeam(NULL) {} 00053 PVLEPlayer(PVLETeam * pTeam) : pTeam(pTeam) {} 00054 00055 PVLETeam * getTeam() { return pTeam; } 00056 void setTeam(PVLETeam * pTeam) { onTeamChange(this->pTeam, pTeam); this->pTeam = pTeam; } 00057 00058 ControlMapper & getControlMapper() { return controlMapper; } 00059 const ControlMapper & getControlMapper() const { return controlMapper; } 00060 00061 #ifdef PVLE_NETWORKING 00062 virtual void onGhostAvailable(TNL::GhostConnection * pConnection); 00063 #endif 00064 00065 protected: 00066 //UINT id; ///< Unique player identifyer 00067 PVLETeam * pTeam; 00068 PVLEGame * getGame(); 00069 ControlMapper controlMapper; 00070 00072 virtual void onTeamChange(PVLETeam * pOldTeam, PVLETeam * pNewTeam) {} 00073 00076 virtual ~PVLEPlayer() {} 00077 }; 00078 00079 00080 #endif // GAME_PVLE_PLAYER_INFO_H