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

Subschool.h

00001 /*
00002  * Subschool.h -- class interface for subschools 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: Subschool.h,v 1.3 2003/02/25 19:40:27 elemings Exp $
00021  */
00022 
00023 #ifdef __cplusplus
00024 
00025 #  ifndef OGS_MAGIC_SUBSCHOOL_H
00026 #    define OGS_MAGIC_SUBSCHOOL_H
00027 
00028 #    include <string>
00029 
00030 #    include <ogs/magic/Namespace.h>
00031 #    include <ogs/magic/School.h>
00032 
00033 OGS_BEGIN_MAGIC_NAMESPACE
00034 
00038 class Subschool: public School {
00039   public:
00041     enum Type {
00042 
00044       CALLING = 1,
00045 
00047       CREATION = 2,
00048 
00050       HEALING = 3,
00051 
00053       SUMMONING = 4,
00054 
00056       CHARM = 5,
00057 
00059       COMPULSION = 6,
00060 
00062       FIGMENT = 7,
00063 
00065       GLAMER = 8,
00066 
00068       PATTERN = 9,
00069 
00071       PHANTASM = 10,
00072 
00074       SHADOW = 11
00075     };
00076 
00077     Subschool (Type type);
00078     Type getType () const;
00079     std::string getName () const;
00080 
00081   private:
00082     Type type;
00083 
00084     static bool isValid (Type type);
00085     static School::Type getSchool (Type type);
00086 };
00087 
00093 inline Subschool::Type Subschool::getType () const {
00094   return (this->type);
00095 }
00096 
00103 inline School::Type Subschool::getSchool (Type type) {
00104   return (type == CALLING ||
00105           type == CREATION ||
00106           type == HEALING ||
00107           type == SUMMONING? School::CONJURATION:
00108           type == CHARM ||
00109           type == COMPULSION? School::ENCHANTMENT:
00110           type == FIGMENT ||
00111           type == GLAMER ||
00112           type == PATTERN ||
00113           type == PHANTASM ||
00114           type == SHADOW? School::ILLUSION: School::Type (0));
00115 }
00116 
00117 OGS_END_MAGIC_NAMESPACE
00118 
00119 #  endif /* !defined OGS_MAGIC_SUBSCHOOL_H */
00120 
00121 #endif /* defined __cplusplus */
00122 

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