activator.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2004-2005 by Reality Rift Studios                       *
00003  *   http://www.realityrift.com  -  mattias@realityrift.com                *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program 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 program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 
00021 #ifndef neo_core_activator_h
00022 #define neo_core_activator_h
00023 
00027 #include "platform.h"
00028 
00029 #if NEO_ENABLE_SCRIPTING
00030 #  include "../script/binding.h"
00031 #endif
00032 
00033 namespace neo {
00034 namespace core {
00035 
00059 class Activator
00060 #if NEO_ENABLE_SCRIPTING
00061     : public virtual script::Scriptable
00062 #endif
00063 {
00064     public:
00065 
00067 
00070                                                             Activator( bool active = true );
00071     
00073 
00076                                                             Activator( const Activator& ref );
00077     
00078     virtual                                                ~Activator();
00079     
00081 
00084     void                                                    activate();
00085 
00087 
00090     void                                                    deactivate();
00091 
00093 
00096     inline bool                                             toggle();
00097 
00099 
00101     inline bool                                             isActive() const;
00102     
00104 
00108     Activator&                                              operator = ( const Activator& rhs );
00109 
00110     protected:
00111         
00113 
00116     virtual void                                            onActiveStateChange();
00117     
00118 #if NEO_ENABLE_SCRIPTING
00119     virtual void                                            getEvents( core::Array< std::string >* p_events );
00120 #endif
00121 
00122     private:
00123 
00125     bool                                                    _active;
00126 };
00127 
00128 #include "activator.inl"
00129 
00130 }
00131 }
00132 
00133 #endif

Generated on Sat Feb 17 20:50:47 2007 for NeoEngine 2 - Evolution by  doxygen 1.5.1