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

PhysicalComponent.h

00001 /*
00002  * PhysicalComponent.h -- class interface for physical components
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: PhysicalComponent.h,v 1.3 2003/02/28 11:11:25 elemings Exp $
00021  */
00022 
00023 #ifdef __cplusplus
00024 
00025 #  ifndef OGS_MAGIC_PHYSICAL_COMPONENT_H
00026 #    define OGS_MAGIC_PHYSICAL_COMPONENT_H
00027 
00028 #    include <string>
00029 
00030 #    include <ogs/magic/Component.h>
00031 #    include <ogs/magic/Namespace.h>
00032 
00033 OGS_BEGIN_MAGIC_NAMESPACE
00034 
00041 class PhysicalComponent: public Component {
00042   public:
00043     static PhysicalComponent
00044     Material                       (const std::string& details,
00045                                     float cost = 0.0,
00046                                     bool useDivineFocus = false);
00047     static PhysicalComponent
00048     Focus                          (const std::string& details,
00049                                     float cost = 0.0,
00050                                     bool useDivineFocus = false);
00051 
00052     const std::string& getDetails () const;
00053     float getCost () const;
00054     bool useDivineFocus () const;
00055 
00056   protected:
00057     PhysicalComponent              (Component::Type type,
00058                                     const std::string& details,
00059                                     float cost = 0.0,
00060                                     bool useDivineFocus = false);
00061 
00062   private:
00063     std::string _details;
00064     float _cost;
00065     bool _useDivineFocus;
00066 };
00067 
00077 inline PhysicalComponent
00078 PhysicalComponent::Material        (const std::string& details,
00079                                     float cost,
00080                                     bool useDivineFocus) {
00081   return (PhysicalComponent (Component::MATERIAL, details,
00082                              cost, useDivineFocus));
00083 }
00084 
00094 inline PhysicalComponent
00095 PhysicalComponent::Focus           (const std::string& details,
00096                                     float cost,
00097                                     bool useDivineFocus) {
00098   return (PhysicalComponent (Component::FOCUS, details,
00099                              cost, useDivineFocus));
00100 }
00101 
00107 inline const std::string& PhysicalComponent::getDetails () const {
00108   return (this->_details);
00109 }
00110 
00116 inline float PhysicalComponent::getCost () const {
00117   return (this->_cost);
00118 }
00119 
00126 inline bool PhysicalComponent::useDivineFocus () const {
00127   return (this->_useDivineFocus);
00128 }
00129 
00139 inline
00140 PhysicalComponent::PhysicalComponent (Component::Type type,
00141                                     const std::string& details,
00142                                     float cost,
00143                                     bool useDivineFocus):
00144   Component (type), _details (details), _cost (cost),
00145   _useDivineFocus (useDivineFocus) {
00146   // empty body
00147 }
00148 
00149 OGS_END_MAGIC_NAMESPACE
00150 
00151 #  endif /* !defined OGS_MAGIC_PHYSICAL_COMPONENT_H */
00152 
00153 #endif /* defined __cplusplus */
00154 

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