diff options
author | Hans Lambermont <hans@lambermont.dyndns.org> | 2002-10-12 15:37:38 +0400 |
---|---|---|
committer | Hans Lambermont <hans@lambermont.dyndns.org> | 2002-10-12 15:37:38 +0400 |
commit | 12315f4d0e0ae993805f141f64cb8c73c5297311 (patch) | |
tree | 59b45827cd8293cfb727758989c7a74b40183974 /source/gameengine/Expressions/ListValue.h |
Initial revisionv2.25
Diffstat (limited to 'source/gameengine/Expressions/ListValue.h')
-rw-r--r-- | source/gameengine/Expressions/ListValue.h | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/source/gameengine/Expressions/ListValue.h b/source/gameengine/Expressions/ListValue.h new file mode 100644 index 00000000000..fce4e9da8c2 --- /dev/null +++ b/source/gameengine/Expressions/ListValue.h @@ -0,0 +1,77 @@ +/* + * ListValue.h: interface for the CListValue class. + * $Id$ + * Copyright (c) 1996-2000 Erwin Coumans <coockie@acm.org> + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Erwin Coumans makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + */ + +#if !defined _LISTVALUE_H +#define _LISTVALUE_H + + +#include "Value.h" + +class CListValue : public CPropValue +{ + Py_Header; + //PLUGIN_DECLARE_SERIAL (CListValue,CValue) + +public: + CListValue(PyTypeObject *T = &Type); + virtual ~CListValue(); + + void AddConfigurationData(CValue* menuvalue); + void Configure(CValue* menuvalue); + void Add(CValue* value); + + /** @attention not implemented yet :( */ + virtual CValue* Calc(VALUE_OPERATOR op,CValue *val); + virtual CValue* CalcFinal(VALUE_DATA_TYPE dtype, + VALUE_OPERATOR op, + CValue* val); + virtual float GetNumber(); + virtual CValue* GetReplica(); + +public: + void MergeList(CListValue* otherlist); + bool RemoveValue(CValue* val); + void SetReleaseOnDestruct(bool bReleaseContents); + bool SearchValue(CValue* val); + + CValue* FindValue(const STR_String & name); + + void ReleaseAndRemoveAll(); + virtual void SetModified(bool bModified); + virtual inline bool IsModified(); + void Remove(int i); + void Resize(int num); + void SetValue(int i,CValue* val); + CValue* GetValue(int i){ assertd(i < m_pValueArray.size()); return m_pValueArray[i];} + int GetCount() { return m_pValueArray.size();}; + virtual const STR_String & GetText(); + + bool CheckEqual(CValue* first,CValue* second); + + virtual PyObject* _getattr(char *attr); + + KX_PYMETHOD(CListValue,append); + KX_PYMETHOD(CListValue,reverse); + KX_PYMETHOD(CListValue,index); + KX_PYMETHOD(CListValue,count); + + +private: + + std::vector<CValue*> m_pValueArray; + bool m_bReleaseContents; +}; + +#endif // !defined _LISTVALUE_H |