svn merge -r 21041:21301 https://svn.blender.org/svnroot/bf-blender/branches/blender2...
[blender.git] / source / gameengine / GameLogic / SCA_DelaySensor.h
1 /**
2  * SCA_DelaySensor.h
3  *
4  * $Id$
5  *
6  * ***** BEGIN GPL LICENSE BLOCK *****
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software Foundation,
20  * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
21  *
22  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
23  * All rights reserved.
24  *
25  * The Original Code is: all of this file.
26  *
27  * Contributor(s): none yet.
28  *
29  * ***** END GPL LICENSE BLOCK *****
30  */
31
32 #ifndef __KX_DELAYSENSOR
33 #define __KX_DELAYSENSOR
34 #include "SCA_ISensor.h"
35
36 class SCA_DelaySensor : public SCA_ISensor
37 {
38         Py_Header;
39         bool                    m_lastResult;
40         bool                    m_repeat;
41         int                             m_delay; 
42         int                             m_duration;
43         int                             m_frameCount;
44
45 public:
46         SCA_DelaySensor(class SCA_EventManager* eventmgr,
47                                         SCA_IObject* gameobj,
48                                         int delay,
49                                         int duration,
50                                         bool repeat);
51         virtual ~SCA_DelaySensor();
52         virtual CValue* GetReplica();
53         virtual bool Evaluate();
54         virtual bool IsPositiveTrigger();
55         virtual void Init();
56
57
58         /* --------------------------------------------------------------------- */
59         /* Python interface ---------------------------------------------------- */
60         /* --------------------------------------------------------------------- */
61
62         /* setProperty */
63         KX_PYMETHOD_DOC_VARARGS(SCA_DelaySensor,SetDelay);
64         KX_PYMETHOD_DOC_VARARGS(SCA_DelaySensor,SetDuration);
65         KX_PYMETHOD_DOC_VARARGS(SCA_DelaySensor,SetRepeat);
66         /* getProperty */
67         KX_PYMETHOD_DOC_NOARGS(SCA_DelaySensor,GetDelay);
68         KX_PYMETHOD_DOC_NOARGS(SCA_DelaySensor,GetDuration);
69         KX_PYMETHOD_DOC_NOARGS(SCA_DelaySensor,GetRepeat);
70
71 };
72
73 #endif //__KX_ALWAYSSENSOR
74