00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __CS_IENGINE_SHAREVAR_H__
00020 #define __CS_IENGINE_SHAREVAR_H__
00021
00028 #include "cstypes.h"
00029 #include "csutil/scf.h"
00030 #include "csutil/cscolor.h"
00031 #include "csgeom/vector3.h"
00032
00033 struct iSharedVariableListener;
00034
00035 SCF_VERSION (iSharedVariable, 0, 1, 0);
00036
00041 struct iSharedVariable : public iBase
00042 {
00044 virtual iObject* QueryObject () = 0;
00045
00047 virtual void SetName (const char *name) = 0;
00048
00050 virtual const char *GetName () const = 0;
00051
00053 virtual void Set(float val) = 0;
00054
00056 virtual float Get () const = 0;
00057
00059 virtual void SetColor (const csColor& col) = 0;
00060
00062 virtual const csColor& GetColor () const = 0;
00063
00065 virtual void SetVector (const csVector3& v) = 0;
00066
00068 virtual const csVector3& GetVector () const = 0;
00069
00071 enum SharedVariableType
00072 {
00073 SV_UNKNOWN = 0,
00074 SV_FLOAT = 1,
00075 SV_COLOR = 2,
00076 SV_VECTOR = 3
00077 };
00078
00080 virtual int GetType () const = 0;
00081
00083 virtual void AddListener (iSharedVariableListener* listener) = 0;
00084
00086 virtual void RemoveListener (iSharedVariableListener* listener) = 0;
00087 };
00088
00089 SCF_VERSION (iSharedVariableListener, 0, 0, 1);
00090
00095 struct iSharedVariableListener : public iBase
00096 {
00100 virtual void VariableChanged (iSharedVariable* var) = 0;
00101 };
00102
00103 SCF_VERSION (iSharedVariableList, 0, 0, 2);
00104
00108 struct iSharedVariableList : public iBase
00109 {
00111 virtual int GetCount () const = 0;
00112
00114 virtual iSharedVariable *Get (int n) const = 0;
00115
00117 virtual int Add (iSharedVariable *obj) = 0;
00118
00120 virtual bool Remove (iSharedVariable *obj) = 0;
00121
00123 virtual bool Remove (int n) = 0;
00124
00126 virtual void RemoveAll () = 0;
00127
00129 virtual int Find (iSharedVariable *obj) const = 0;
00130
00132 virtual iSharedVariable *FindByName (const char *Name) const = 0;
00133
00135 virtual csPtr<iSharedVariable> New() const = 0;
00136 };
00137
00138 #endif // __CS_IENGINE_SHAREVAR_H__