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

Protection.h

00001 /*
00002  * Protection.h -- class interface for rings of protection
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: Protection.h,v 1.2 2003/04/18 01:41:05 elemings Exp $
00021  */
00022 
00023 #ifdef __cplusplus
00024 
00025 #  ifndef OGS_ITEMS_RINGS_PROTECTION_H
00026 #    define OGS_ITEMS_RINGS_PROTECTION_H
00027 
00028 #    include <ogs/core/Modifier.h>
00029 
00030 #    include <ogs/items/Ring.h>
00031 #    include <ogs/items/rings/Namespace.h>
00032 
00033 OGS_BEGIN_ITEMS_RINGS_NAMESPACE
00034 
00043 class Protection: public Ring {
00044   public:
00046     enum Bonus {
00048        PLUS_1 = 1,
00050        PLUS_2 = 2,
00052        PLUS_3 = 3,
00054        PLUS_4 = 4,
00056        PLUS_5 = 5
00057     };
00058 
00059     Protection (Bonus bonus);
00060 
00061     unsigned getCasterLevel () const;
00062 
00063     void equipItem (Creature& creature);
00064     void unequipItem (Creature& creature);
00065 
00066     const Modifier& getModifier () const;
00067 
00068   private:
00069     Modifier _modifier;
00070 };
00071 
00077 Protection::Protection (Bonus bonus):
00078   _modifier (bonus) {
00079   // empty constructor body
00080 }
00081 
00087 inline unsigned Protection::getCasterLevel () const {
00088   return (5);
00089 }
00090 
00097 inline const Modifier& Protection::getModifier () const {
00098   return (_modifier);
00099 }
00100 
00101 OGS_END_ITEMS_RINGS_NAMESPACE
00102 
00103 #  endif /* !defined OGS_ITEMS_RINGS_PROTECTION_H */
00104 
00105 #endif /* defined __cplusplus */
00106 

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