1 //////////////////////////////////////////////////////////////////////////////// 2 // Scorched3D (c) 2000-2011 3 // 4 // This file is part of Scorched3D. 5 // 6 // Scorched3D is free software; you can redistribute it and/or modify 7 // it under the terms of the GNU General Public License as published by 8 // the Free Software Foundation; either version 2 of the License, or 9 // (at your option) any later version. 10 // 11 // Scorched3D is distributed in the hope that it will be useful, 12 // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 // GNU General Public License for more details. 15 // 16 // You should have received a copy of the GNU General Public License along 17 // with this program; if not, write to the Free Software Foundation, Inc., 18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 //////////////////////////////////////////////////////////////////////////////// 20 21 #ifndef _ComsTankChangeMessage_h 22 #define _ComsTankChangeMessage_h 23 24 #include <coms/ComsMessage.h> 25 #include <common/Vector.h> 26 27 class ComsTankChangeMessage : public ComsMessage 28 { 29 public: 30 static ComsMessageType ComsTankChangeMessageType; 31 32 ComsTankChangeMessage(); 33 ComsTankChangeMessage(ComsTankChangeMessage &other); 34 ComsTankChangeMessage( 35 unsigned int playerId, 36 const LangString &playerName, 37 Vector playerColor, 38 const char *tankType, 39 const char *modelName, 40 unsigned int destinationId, 41 unsigned int playerTeam, 42 const char *playerType, 43 bool spectate); 44 virtual ~ComsTankChangeMessage(); 45 getPlayerName()46 const LangString &getPlayerName() { return playerName_; } setPlayerName(const LangString & name)47 void setPlayerName(const LangString &name) { playerName_ = name; } getPlayerType()48 const char *getPlayerType() { return playerType_.c_str(); } getModelName()49 const char *getModelName() { return modelName_.c_str(); } getTankType()50 const char *getTankType() { return tankType_.c_str(); } setModelName(const char * modelName)51 void setModelName(const char *modelName) { modelName_ = modelName; } getPlayerId()52 unsigned int getPlayerId() { return playerId_; } getPlayerColor()53 Vector &getPlayerColor() { return playerColor_; } getDestinationId()54 unsigned int getDestinationId() { return destinationId_; } getPlayerTeam()55 unsigned int getPlayerTeam() { return playerTeam_; } getSpectate()56 bool getSpectate() { return spectate_; } 57 setPlayerIconName(const char * name)58 void setPlayerIconName(const char *name) { playerIconName_ = name; } getPlayerIconName()59 const char *getPlayerIconName() { return playerIconName_.c_str(); } getPlayerIcon()60 NetBuffer &getPlayerIcon() { return playerIcon_; } 61 62 // Inherited from ComsMessage 63 virtual bool writeMessage(NetBuffer &buffer); 64 virtual bool readMessage(NetBufferReader &reader); 65 66 protected: 67 unsigned int playerId_; 68 unsigned int destinationId_; 69 unsigned int playerTeam_; 70 LangString playerName_; 71 std::string tankType_; 72 std::string playerType_; 73 std::string modelName_; 74 std::string playerIconName_; 75 Vector playerColor_; 76 bool spectate_; 77 NetBuffer playerIcon_; 78 79 private: 80 const ComsTankChangeMessage & operator=(const ComsTankChangeMessage &); 81 82 }; 83 84 #endif // _ComsTankChangeMessage_h 85 86