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

Strength.h

00001 /*
00002  * Strength.h -- class interface for Strength abilities
00003  * Copyright (C) 2002  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: Strength.h,v 1.3 2003/04/15 16:58:37 elemings Exp $
00021  */
00022 
00023 #ifdef __cplusplus
00024 
00025 #  ifndef OGS_CORE_STRENGTH_H
00026 #    define OGS_CORE_STRENGTH_H
00027 
00028 #    include <ogs/core/Ability.h>
00029 #    include <ogs/core/Namespace.h>
00030 #    include <ogs/core/Size.h>
00031 
00032 OGS_BEGIN_CORE_NAMESPACE
00033 
00043 class Strength: public Ability {
00044   public:
00045     Strength ();
00046     Strength (Ability::Method& method);
00047 
00048     float getLightLoad (Size::Type sizeType = Size::MEDIUM) const;
00049     float getMediumLoad (Size::Type sizeType = Size::MEDIUM) const;
00050     float getHeavyLoad (Size::Type sizeType = Size::MEDIUM) const;
00051 
00052   private:
00053     float getMediumSizeHeavyLoad () const;
00054     static float getLoadFactor (Size::Type size);
00055 };
00056 
00061 inline
00062 Strength::Strength ():
00063   Ability (Ability::STR) {
00064   // empty constructor body
00065 }
00066 
00072 inline
00073 Strength::Strength (Ability::Method& method):
00074   Ability (Ability::STR, method) {
00075   // empty constructor body
00076 }
00077 
00084 inline float
00085 Strength::getLightLoad (Size::Type sizeType) const {
00086   return (getHeavyLoad (sizeType) / 3);
00087 }
00088 
00095 inline float
00096 Strength::getMediumLoad (Size::Type sizeType) const {
00097   return ((2 * getHeavyLoad (sizeType)) / 3);
00098 }
00099 
00106 inline float
00107 Strength::getHeavyLoad (Size::Type sizeType) const {
00108   return (getMediumSizeHeavyLoad () * getLoadFactor (sizeType));
00109 }
00110 
00111 OGS_END_CORE_NAMESPACE
00112 
00113 #  endif /* !defined OGS_CORE_STRENGTH_H */
00114 
00115 #endif /* defined __cplusplus */
00116 

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