Shield.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(AFX_SHIELD_H__F9BCDF39_FB62_4BB4_9D64_C70215669F9C__INCLUDED_)
00022 #define AFX_SHIELD_H__F9BCDF39_FB62_4BB4_9D64_C70215669F9C__INCLUDED_
00023 
00024 #include <weapons/AccessoryPart.h>
00025 #include <common/Vector.h>
00026 
00027 class Shield : public AccessoryPart
00028 {
00029 public:
00030         enum ShieldType
00031         {
00032                 ShieldTypeRoundNormal,
00033                 ShieldTypeRoundReflective,
00034                 ShieldTypeRoundMag,
00035                 ShieldTypeSquareNormal,
00036                 ShieldTypeSquareReflective
00037         };
00038         enum ShieldMovementType
00039         {
00040                 ShieldMovementAll,
00041                 ShieldMovementNone,
00042                 ShieldMovementSame,
00043                 ShieldMovementTeam1,
00044                 ShieldMovementTeam2,
00045                 ShieldMovementTeam3,
00046                 ShieldMovementTeam4
00047         };
00048         enum ShieldLaserProofType
00049         {
00050                 ShieldLaserProofNone,
00051                 ShieldLaserProofStop,
00052                 ShieldLaserProofTotal
00053         };
00054 
00055         Shield();
00056         virtual ~Shield();
00057 
00058         virtual bool parseXML(AccessoryCreateContext &context,
00059                 XMLNode *accessoryNode);
00060 
00061         // Shield attributes
00062         const char *getCollisionSound();
00063         fixed getHitRemovePower() { return removePower_; }
00064         fixed getHitPenetration() { return penetration_; }
00065         fixed getPower() { return power_; }
00066         Vector &getColor() { return color_; }
00067         ShieldLaserProofType getLaserProof() { return laserProof_; }
00068         ShieldMovementType getMovementProof() { return movementProof_; }
00069 
00070         virtual fixed getBoundingSize() = 0;
00071         virtual bool inShield(FixedVector &offset) = 0;
00072         virtual bool tankInShield(FixedVector &offset) = 0;
00073         virtual ShieldType getShieldType() = 0;
00074         virtual bool getRound() = 0;
00075 
00076 protected:
00077         std::string collisionSound_;
00078         Vector color_;
00079         fixed removePower_;
00080         fixed penetration_;
00081         fixed power_;
00082         ShieldLaserProofType laserProof_;
00083         ShieldMovementType movementProof_;
00084 };
00085 
00086 #endif // !defined(AFX_SHIELD_H__F9BCDF39_FB62_4BB4_9D64_C70215669F9C__INCLUDED_)

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