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

SingleWeapon.h

00001 /*
00002  * SingleWeapon.h -- class interface for single weapon proficiency feats
00003  * Copyright (C) 2003  Eric Lemings <elemings@users.sourceforge.net>
00004  *
00005  * This software is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  *
00010  * This software is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this software; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00018  * 02111-1307, USA
00019  *
00020  * RCS: $Id: SingleWeapon.h,v 1.1 2003/03/29 02:10:38 elemings Exp $
00021  */
00022 
00023 #ifdef __cplusplus
00024 
00025 #  ifndef OGS_FEATS_SINGLE_WEAPON_H
00026 #    define OGS_FEATS_SINGLE_WEAPON_H
00027 
00028 #    include <ogs/feats/Namespace.h>
00029 #    include <ogs/feats/WeaponProficiency.h>
00030 #    include <ogs/items/Weapon.h>
00031 
00032 OGS_BEGIN_FEATS_NAMESPACE
00033 
00040 template <class _WeaponType>
00041 class SingleWeapon: public WeaponProficiency {
00042   public:
00044     typedef _WeaponType WeaponType;
00045 
00046     SingleWeapon ();
00047 
00048     Feat::Compatibility getCompatibility () const;
00049     ogs::items::Weapon::Proficiency getProficiency () const;
00050     bool isProficient (const ogs::items::Weapon& weapon) const;
00051 
00052   private:
00053     bool canAttach (const Object& object) const;
00054 };
00055 
00063 template <class _WeaponType>
00064 inline ogs::core::Feat::Compatibility
00065 SingleWeapon<_WeaponType>::getCompatibility () const {
00066   return (Feat::REPEATABLE);
00067 }
00068 
00074 template <class _WeaponType>
00075 inline ogs::items::Weapon::Proficiency
00076 SingleWeapon<_WeaponType>::getProficiency () const {
00077   WeaponType weapon;
00078   return (weapon.getProficiency ());
00079 }
00080 
00081 OGS_END_FEATS_NAMESPACE
00082 
00083 #  endif /* !defined OGS_FEATS_SINGLE_WEAPON_H */
00084 
00085 #endif /* defined __cplusplus */
00086 

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