ComsPlayedMoveMessage.h

Go to the documentation of this file.
00001 ////////////////////////////////////////////////////////////////////////////////
00002 //    Scorched3D (c) 2000-2009
00003 //
00004 //    This file is part of Scorched3D.
00005 //
00006 //    Scorched3D is free software; you can redistribute it and/or modify
00007 //    it under the terms of the GNU General Public License as published by
00008 //    the Free Software Foundation; either version 2 of the License, or
00009 //    (at your option) any later version.
00010 //
00011 //    Scorched3D 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 Scorched3D; if not, write to the Free Software
00018 //    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 ////////////////////////////////////////////////////////////////////////////////
00020 
00021 #if !defined(__INCLUDE_ComsPlayedMoveMessageh_INCLUDE__)
00022 #define __INCLUDE_ComsPlayedMoveMessageh_INCLUDE__
00023 
00024 #include <coms/ComsMessage.h>
00025 
00026 class ComsPlayedMoveMessage : public ComsMessage
00027 {
00028 public:
00029         enum MoveType
00030         {
00031                 eNone,
00032                 eShot,
00033                 eResign,
00034                 eSkip,
00035                 eFinishedBuy
00036         };
00037 
00038         ComsPlayedMoveMessage(unsigned int playerId = 0,
00039                 MoveType type = eNone);
00040         virtual ~ComsPlayedMoveMessage();
00041 
00042         void setShot(unsigned int weaponId,
00043                 fixed rotationXY,
00044                 fixed rotationYZ,
00045                 fixed power,
00046                 int positionX, 
00047                 int positionY);
00048 
00049         unsigned int getPlayerId() { return playerId_; }
00050         unsigned int getWeaponId() { return weaponId_; }
00051         fixed getRotationXY() { return rotationXY_; }
00052         fixed getRotationYZ() { return rotationYZ_; }
00053         int getSelectPositionX() { return selectPositionX_; }
00054         int getSelectPositionY() { return selectPositionY_; }
00055         fixed getPower() { return power_; }
00056         MoveType getType() { return moveType_; }
00057 
00058         // Inherited from ComsMessage
00059     virtual bool writeMessage(NetBuffer &buffer);
00060     virtual bool readMessage(NetBufferReader &reader);
00061 
00062 protected:
00063         unsigned int playerId_;
00064         unsigned int weaponId_;
00065         MoveType moveType_;
00066         fixed rotationXY_;
00067         fixed rotationYZ_;
00068         fixed power_;
00069         int selectPositionX_;
00070         int selectPositionY_;
00071 
00072 private:
00073         ComsPlayedMoveMessage(const ComsPlayedMoveMessage &);
00074         const ComsPlayedMoveMessage & operator=(const ComsPlayedMoveMessage &);
00075 };
00076 
00077 #endif

Generated on Mon Feb 16 15:14:49 2009 for Scorched3D by  doxygen 1.5.3