fixed spacing in the headers to get rid of some warnings and some other
[blender.git] / source / gameengine / Ketsji / KX_SceneActuator.h
1  
2 //
3 // Add object to the game world on action of this actuator
4 //
5 // $Id$
6 //
7 // ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
8 //
9 // This program is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU General Public License
11 // as published by the Free Software Foundation; either version 2
12 // of the License, or (at your option) any later version. The Blender
13 // Foundation also sells licenses for use in proprietary software under
14 // the Blender License.  See http://www.blender.org/BL/ for information
15 // about this.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software Foundation,
24 // Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
25 //
26 // The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
27 // All rights reserved.
28 //
29 // The Original Code is: all of this file.
30 //
31 // Contributor(s): none yet.
32 //
33 // ***** END GPL/BL DUAL LICENSE BLOCK *****
34 //
35
36 #ifndef __KX_SCENEACTUATOR
37 #define __KX_SCENEACTUATOR
38
39 #include "SCA_IActuator.h"
40
41 class KX_SceneActuator : public SCA_IActuator
42 {
43         Py_Header;
44         
45         int                                                     m_mode;
46         // (restart) has become a toggle internally... not in the interface though
47         bool                                            m_restart;
48         // (set Scene) Scene
49         /** The current scene. */
50         class   KX_Scene*                       m_scene;
51         class   KX_KetsjiEngine*        m_KetsjiEngine;
52         /** The scene to switch to. */
53         STR_String                                      m_nextSceneName;
54         
55         // (Set Camera) Object
56         class KX_Camera*                        m_camera;
57
58         /** Is this a valid scene? */
59         class KX_Scene* FindScene(char* sceneName);
60         /** Is this a valid camera? */
61         class KX_Camera* FindCamera(char* cameraName);
62         
63  public:
64         enum SCA_SceneActuatorMode
65         {
66                 KX_SCENE_NODEF = 0,
67                 KX_SCENE_RESTART,
68                 KX_SCENE_SET_SCENE,
69                 KX_SCENE_SET_CAMERA,
70                 KX_SCENE_ADD_FRONT_SCENE,
71                 KX_SCENE_ADD_BACK_SCENE,
72                 KX_SCENE_REMOVE_SCENE,
73                 KX_SCENE_SUSPEND,
74                 KX_SCENE_RESUME,
75                 KX_SCENE_MAX
76         };
77         
78         KX_SceneActuator(SCA_IObject* gameobj,
79                                          int mode,
80                                          KX_Scene* scene,
81                                          KX_KetsjiEngine* ketsjiEngine,
82                                          const STR_String& nextSceneName,
83                                          KX_Camera* camera,
84                                          PyTypeObject* T=&Type);
85         virtual ~KX_SceneActuator();
86
87         virtual CValue* GetReplica();
88
89         virtual bool Update(double curtime,double deltatime);
90         
91         /* --------------------------------------------------------------------- */
92         /* Python interface ---------------------------------------------------- */
93         /* --------------------------------------------------------------------- */
94
95         virtual PyObject*  _getattr(char *attr);
96
97         /* 1. set                                                                */
98         /* Removed */
99           
100         /* 2. setUseRestart:                                                     */
101         KX_PYMETHOD_DOC(KX_SceneActuator,SetUseRestart);
102         /* 3. getUseRestart:                                                     */
103         KX_PYMETHOD_DOC(KX_SceneActuator,GetUseRestart);
104         /* 4. setScene:                                                          */
105         KX_PYMETHOD_DOC(KX_SceneActuator,SetScene);
106         /* 5. getScene:                                                          */
107         KX_PYMETHOD_DOC(KX_SceneActuator,GetScene);
108         /* 6. setCamera:                                                          */
109         KX_PYMETHOD_DOC(KX_SceneActuator,SetCamera);
110         /* 7. getCamera:                                                          */
111         KX_PYMETHOD_DOC(KX_SceneActuator,GetCamera);
112         
113 }; /* end of class KXSceneActuator */
114
115 #endif
116