Name attributes added since 2.48a more consistently.
[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                                         PyTypeObject* T =&Type);
52         virtual ~SCA_DelaySensor();
53         virtual CValue* GetReplica();
54         virtual bool Evaluate();
55         virtual bool IsPositiveTrigger();
56         virtual void Init();
57
58
59         /* --------------------------------------------------------------------- */
60         /* Python interface ---------------------------------------------------- */
61         /* --------------------------------------------------------------------- */
62         
63         virtual PyObject* py_getattro(PyObject *attr);
64         virtual PyObject*               py_getattro_dict();
65         virtual int py_setattro(PyObject *attr, PyObject *value);
66
67         /* setProperty */
68         KX_PYMETHOD_DOC_VARARGS(SCA_DelaySensor,SetDelay);
69         KX_PYMETHOD_DOC_VARARGS(SCA_DelaySensor,SetDuration);
70         KX_PYMETHOD_DOC_VARARGS(SCA_DelaySensor,SetRepeat);
71         /* getProperty */
72         KX_PYMETHOD_DOC_NOARGS(SCA_DelaySensor,GetDelay);
73         KX_PYMETHOD_DOC_NOARGS(SCA_DelaySensor,GetDuration);
74         KX_PYMETHOD_DOC_NOARGS(SCA_DelaySensor,GetRepeat);
75
76 };
77
78 #endif //__KX_ALWAYSSENSOR
79