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

School.h

00001 /*
00002  * School.h -- class interface for schools of arcane magic
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: School.h,v 1.3 2003/03/23 22:14:36 elemings Exp $
00021  */
00022 
00023 #ifdef __cplusplus
00024 
00025 #  ifndef OGS_MAGIC_SCHOOL_H
00026 #    define OGS_MAGIC_SCHOOL_H
00027 
00028 #    include <string>
00029 
00030 #    include <ogs/magic/Namespace.h>
00031 
00032 OGS_BEGIN_MAGIC_NAMESPACE
00033 
00038 class School {
00039   public:
00041     enum Type {
00045       UNIVERSAL = 0,
00046 
00053       ABJURATION = 1,
00054 
00062       CONJURATION = 2,
00063 
00069       DIVINATION = 3,
00070 
00077       ENCHANTMENT = 4,
00078 
00086       EVOCATION = 5,
00087 
00094       ILLUSION = 6,
00095 
00101       NECROMANCY = 7,
00102 
00109       TRANSMUTATION = 8
00110     };
00111 
00112     School (Type type);
00113     Type getType () const;
00114     std::string getName () const;
00115 
00116   private:
00117     Type type;
00118     static bool isValid (Type type);
00119 };
00120 
00126 inline School::Type School::getType () const {
00127   return (this->type);
00128 }
00129 
00136 inline bool School::isValid (Type type) {
00137   return (type == UNIVERSAL ||
00138           type == ABJURATION ||
00139           type == CONJURATION ||
00140           type == DIVINATION ||
00141           type == ENCHANTMENT ||
00142           type == EVOCATION ||
00143           type == ILLUSION ||
00144           type == NECROMANCY ||
00145           type == TRANSMUTATION);
00146 }
00147 
00148 OGS_END_MAGIC_NAMESPACE
00149 
00150 #  endif /* !defined OGS_MAGIC_SCHOOL_H */
00151 
00152 #endif /* defined __cplusplus */
00153 

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