Neo  0.5.0
Developer Documentation
Behavior.h
Go to the documentation of this file.
1 //========================================================================
2 // Copyright (c) 2003-2011 Anael Seghezzi <www.maratis3d.com>
3 //
4 // This software is provided 'as-is', without any express or implied
5 // warranty. In no event will the authors be held liable for any damages
6 // arising from the use of this software.
7 //
8 // Permission is granted to anyone to use this software for any purpose,
9 // including commercial applications, and to alter it and redistribute it
10 // freely, subject to the following restrictions:
11 //
12 // 1. The origin of this software must not be misrepresented; you must not
13 // claim that you wrote the original software. If you use this software
14 // in a product, an acknowledgment in the product documentation would
15 // be appreciated but is not required.
16 //
17 // 2. Altered source versions must be plainly marked as such, and must not
18 // be misrepresented as being the original software.
19 //
20 // 3. This notice may not be removed or altered from any source
21 // distribution.
22 //
23 //========================================================================
24 
25 
26 #ifndef __BEHAVIOR_H
27 #define __BEHAVIOR_H
28 
29 namespace Neo
30 {
31 // class for creating behaviors
39 class NEO_ENGINE_EXPORT Behavior
40 {
41 public:
42 
47  Behavior(Object3d * parentObject);
48  virtual ~Behavior(void);
49 
50 private:
51 
52  Object3d * m_parentObject;
53 
54 public:
55 
56  // destroy
57  virtual void destroy(void) = 0;
58 
59  // parent
64  inline Object3d * getParentObject(void){ return m_parentObject; }
65 
66  // name
75  virtual const char * getName(void) = 0;
76 
77  // get copy
83  virtual Behavior * getCopy(Object3d * parentObject) = 0;
84 
85  // events
94  virtual void update(void) = 0;
95 
103  virtual void draw(void){}
104  virtual void runEvent(int param){}
105 
106  // variables
115  virtual unsigned int getVariablesNumber(void) = 0;
116 
143  virtual NeoVariable getVariable(unsigned int id) = 0;
144 };
145 }
146 
147 #endif
virtual void runEvent(int param)
Definition: Behavior.h:104
virtual void draw(void)
Draws behavior specific images to the screen.
Definition: Behavior.h:103
Object3d * getParentObject(void)
Returns the parent object.
Definition: Behavior.h:64
The Object3d class represents a general object in a 3D scene.
Definition: Object3d.h:43
Definition: Color.h:29
The NeoVariable class defines a variable that can be of any type available in M_VARIABLE_TYPE.
Definition: PointerVariable.h:55
The Behavior class is an abstraction for creating behaviors.
Definition: Behavior.h:39