Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

Weapon.h

00001 /*
00002  * Weapon.h -- class interface for weapons
00003  * Copyright (C) 2003  Eric Lemings <elemings@users.sourceforge.net>
00004  * * This software is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This software is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this software; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00017  * 02111-1307, USA
00018  *
00019  * RCS: $Id: Weapon.h,v 1.3 2003/03/29 02:10:39 elemings Exp $
00020  */
00021 
00022 #ifdef __cplusplus
00023 
00024 #  ifndef OGS_ITEMS_WEAPON_H
00025 #    define OGS_ITEMS_WEAPON_H
00026 
00027 #    include <bitset>
00028 
00029 #    include <ogs/core/Die.h>
00030 #    include <ogs/core/Item.h>
00031 #    include <ogs/items/Namespace.h>
00032 
00033 OGS_BEGIN_ITEMS_NAMESPACE
00034 
00040 class Weapon: public ogs::core::Item {
00041   public:
00046     enum Proficiency {
00047 
00049       SIMPLE = 1,
00050 
00052       MARTIAL = 2,
00053 
00055       EXOTIC = 3
00056     };
00057 
00063     typedef std::bitset<3> Type;
00064 
00065     enum {
00067       BASHING = 0,
00068 
00070       PIERCING = 1,
00071 
00073       SLASHING = 2,
00074     };
00075 
00076     Weapon ();
00077     Weapon (Entity::Weight weight, ogs::core::Size::Type size,
00078             Item::Worth worth, Proficiency proficiency, Type type,
00079             const ogs::core::Die& damage, unsigned criticalMultiplier,
00080             ogs::core::Die::Value threatRange);
00081     virtual ~Weapon () { }
00082 
00083     Proficiency getProficiency () const;
00084     Type getType () const;
00085     ogs::core::Die getDamage () const;
00086     unsigned getCriticalMultiplier () const;
00087     ogs::core::Die::Value getThreatRange () const;
00088 
00089   private:
00090     Proficiency _proficiency;
00091     Type _type;
00092     ogs::core::Die _damage;
00093     unsigned _criticalMultiplier;
00094     ogs::core::Die::Value _threatRange;
00095 };
00096 
00102 inline Weapon::Proficiency
00103 Weapon::getProficiency () const {
00104   return (this->_proficiency);
00105 }
00106 
00112 inline Weapon::Type
00113 Weapon::getType () const {
00114   return (this->_type);
00115 }
00116 
00122 inline ogs::core::Die
00123 Weapon::getDamage () const {
00124   return (this->_damage);
00125 }
00126 
00132 inline unsigned
00133 Weapon::getCriticalMultiplier () const {
00134   return (this->_criticalMultiplier);
00135 }
00136 
00142 inline ogs::core::Die::Value
00143 Weapon::getThreatRange () const {
00144   return (this->_threatRange);
00145 }
00146 
00147 OGS_END_ITEMS_NAMESPACE
00148 
00149 #  endif /* !defined OGS_ITEMS_WEAPON_H */
00150 
00151 #endif /* defined __cplusplus */
00152 

Generated on Sun Apr 20 03:36:27 2003 for Open Gaming System (OGS) by doxygen1.3