|
Blender
V2.59
|
00001 /* 00002 * $Id: KX_StateActuator.h 35063 2011-02-22 10:33:14Z jesterking $ 00003 * 00004 * ***** BEGIN GPL LICENSE BLOCK ***** 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software Foundation, 00018 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00019 * 00020 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. 00021 * All rights reserved. 00022 * 00023 * The Original Code is: all of this file. 00024 * 00025 * Contributor(s): none yet. 00026 * 00027 * ***** END GPL LICENSE BLOCK ***** 00028 */ 00029 00035 #ifndef __KX_STATEACTUATOR 00036 #define __KX_STATEACTUATOR 00037 00038 #include "SCA_IActuator.h" 00039 00040 00041 /* 00042 * Use of SG_DList : element of actuator being deactivated 00043 * Head: SCA_LogicManager::m_removedActuators 00044 * Use of SG_QList : element of global activated state actuator list 00045 * Head: KX_StateActuator::m_stateActuatorHead 00046 */ 00047 class KX_StateActuator : public SCA_IActuator 00048 { 00049 Py_Header; 00050 00052 enum { 00053 OP_NOP = -1, 00054 OP_CPY = 0, 00055 OP_SET, 00056 OP_CLR, 00057 OP_NEG, 00058 OP_COUNT 00059 }; 00060 // SG_Dlist: element of objects with active actuators, always put in front of the list 00061 // Head: SCA_LogicManager::m_activeActuators 00062 // SG_QList: Head of active state actuators list globally 00063 // Elements: KX_StateActuator 00064 static SG_QList m_stateActuatorHead; 00065 int m_operation; 00066 int m_mask; 00067 00068 public: 00069 00070 KX_StateActuator( 00071 SCA_IObject* gameobj, 00072 int operation, 00073 unsigned int mask 00074 ); 00075 00076 virtual 00077 ~KX_StateActuator( 00078 void 00079 ); 00080 00081 virtual CValue* 00082 GetReplica( 00083 void 00084 ); 00085 00086 virtual bool 00087 Update(); 00088 00089 virtual void Deactivate(); 00090 virtual void Activate(SG_DList& head); 00091 00092 /* --------------------------------------------------------------------- */ 00093 /* Python interface ---------------------------------------------------- */ 00094 /* --------------------------------------------------------------------- */ 00095 00096 }; 00097 00098 #endif 00099