Neo  0.5.0
Developer Documentation
BehaviorManager.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_MANAGER_H
27 #define __BEHAVIOR_MANAGER_H
28 
29 namespace Neo
30 {
34 class NEO_ENGINE_EXPORT BehaviorManager
35 {
36 public:
37 
38  // constructors / destructors
40  virtual ~BehaviorManager(void);
41 
42 private:
43 
44  vector <BehaviorCreator *> m_behaviors;
45 
46 public:
47 
48  void clear(void);
49 
50  // behaviors
51  void addBehavior(const char * name, int objectFilter, Behavior * (*getNewBehaviorFunctionPointer)(Object3d * parentObject));
52  BehaviorCreator * getBehaviorByName(const char * name);
53 
54  inline unsigned int getBehaviorsNumber(void){ return m_behaviors.size(); }
55  inline BehaviorCreator * getBehaviorByIndex(const unsigned int id){ return m_behaviors[id]; }
56 };
57 }
58 #endif
BehaviorManager(void)
Definition: BehaviorManager.h:39
BehaviorCreator * getBehaviorByIndex(const unsigned int id)
Definition: BehaviorManager.h:55
This class manages all registered behaviors.
Definition: BehaviorManager.h:34
unsigned int getBehaviorsNumber(void)
Definition: BehaviorManager.h:54
The Object3d class represents a general object in a 3D scene.
Definition: Object3d.h:43
Definition: Color.h:29
This class is used to instanciate new behavior objects.
Definition: BehaviorCreator.h:34
The Behavior class is an abstraction for creating behaviors.
Definition: Behavior.h:39