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

Range.h

00001 /*
00002  * Range.h -- class interface for spell ranges
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: Range.h,v 1.3 2003/03/29 02:10:39 elemings Exp $
00021  */
00022 
00023 #ifdef __cplusplus
00024 
00025 #  ifndef OGS_MAGIC_RANGE_H
00026 #    define OGS_MAGIC_RANGE_H
00027 
00028 #    include <ogs/magic/Namespace.h>
00029 
00030 OGS_BEGIN_MAGIC_NAMESPACE
00031 
00043 class Range {
00044   public:
00048     enum Type {
00050       PERSONAL = 1,
00051 
00053       TOUCH,
00054 
00056       ABSOLUTE,
00057 
00059       CLOSE,
00060 
00062       MEDIUM,
00063 
00065       LONG,
00066 
00068       UNLIMITED,
00069     };
00070 
00071     static Range Personal ();
00072     static Range Touch ();
00073     static Range Unlimited ();
00074 
00075     Type getType () const;
00076 
00077   protected:
00078     Range (Type type);
00079 
00080   private:
00081     Type _type;
00082 };
00083 
00089 inline Range Range::Personal () {
00090   return (Range (Range::PERSONAL));
00091 }
00092 
00098 inline Range Range::Touch () {
00099   return (Range (Range::TOUCH));
00100 }
00101 
00107 inline Range Range::Unlimited () {
00108   return (Range (Range::UNLIMITED));
00109 }
00110 
00116 inline Range::Range (Type type): _type (type) {
00117   // empty constructor body
00118 }
00119 
00125 inline Range::Type Range::getType () const {
00126   return (this->_type);
00127 };
00128 
00129 OGS_END_MAGIC_NAMESPACE
00130 
00131 #  endif /* !defined OGS_MAGIC_RANGE_H */
00132 
00133 #endif /* defined __cplusplus */
00134 

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