00001
00002
00003
00004
00005
00006 #ifndef __BS_CONTROLLERDEFINITION_H__
00007 #define __BS_CONTROLLERDEFINITION_H__
00008
00009 #include <vector>
00010 #include "bsPrerequisites.h"
00011 #include "bsError.h"
00012 #include "bsObjectDefinition.h"
00013
00014 namespace BS_NMSP
00015 {
00016
00017 class ParseTreeNode;
00018
00024 class _BSAPI ControllerDefinition : public ObjectDefinition
00025 {
00026 public:
00027
00030 struct EmitterVariable
00031 {
00033 String name;
00035 String emitter;
00037 bstype x;
00039 bstype y;
00040 #ifdef BS_Z_DIMENSION
00042 bstype z;
00043 #endif
00045 bstype angle;
00046 };
00047
00050 struct Event
00051 {
00053 String name;
00055 int numArguments;
00057 ParseTreeNode* node;
00059 CodeRecord* code;
00060 };
00061
00062 public:
00063
00067 explicit ControllerDefinition(const String& name);
00068
00076 EmitterVariable& addEmitterVariable(const String& name, const String& emitter,
00077 const bstype* args);
00078
00084 EmitterVariable& getEmitterVariable(int index);
00085
00094 int getEmitterVariableIndex(const String& name) const;
00095
00100 int getNumEmitterVariables() const;
00101
00108 Event& addEvent(const String& name, ParseTreeNode* node);
00109
00115 Event& getEvent(int index);
00116
00124 int getEventIndex(const String& name) const;
00125
00130 int getNumEvents() const;
00131
00137 void setMaxEventLocalVariables(int count);
00138
00144 int getMaxEventLocalVariables() const;
00145
00151 void setMaxBlocks(int count);
00152
00158 int getMaxBlocks() const;
00159
00160 private:
00161
00162
00163 std::vector<EmitterVariable> mEmitterVariables;
00164
00165 std::vector<Event> mEvents;
00166
00167 int mMaxEventLocals;
00168
00169 int mMaxBlocks;
00170
00171 };
00172
00173 }
00174
00175 #endif