7 #include "util/LogService.h" 8 #include "IAttributeFields.h" 15 #pragma region StackObjectPtr 21 class ParaAttributeObject;
27 template <
typename _Ty>
39 operator bool ()
const 41 return _Myptr.IsValid();
44 bool operator! ()
const 46 return !(_Myptr.IsValid());
49 _Ty& operator*()
const 54 _Ty *operator->()
const 61 return (_Ty *)&(_Myptr);
78 T* get_pointer(T
const& pointer){
79 return (T*)(&pointer);
88 #pragma endregion StackObjectPtr 102 enum objecttype{number,
string}
122 bool operator() (
const std::string& first,
const std::string& second)
const 124 return first.compare(second)<0;
128 typedef pair <const char *, ParaObjectNode> ParaObject_Pair;
138 ParaEngine::CServiceLogger_ptr m_logger_ptr;
145 void log(
int level,
const object& message);
154 void SetLevel(
const int level1);
160 bool IsEnabledFor(
int level);
165 void SetAppendMode(
bool bAppendToExistingFile);
171 void SetLogFile(
const char* sFileName);
177 void SetForceFlush(
bool bForceFlush);
190 static void ExitApp();
196 static void Exit(
int nReturnCode);
204 static void WriteToConsole(
const char* strMessage);
208 static void WriteToLogFile(
const char* strMessage);
213 static int GetLogPos();
220 static const char* GetLog(
int fromPos,
int nCount);
230 static bool WriteToFile(
const char* filename,
const char* strMessage);
239 static void SetGameStatus(
const char* strState);
244 static double GetGameTime();
290 static DWORD timeGetTime();
293 static double getAccurateTime();
299 static double random();
314 static std::string GenerateUniqueID();
322 static void SaveObject(
const char* strObjectName,
const object& objObject);
330 static object LoadObject(
const object& strObjectName);
335 static void SetGameLoop(
const char* scriptName);
337 static void SetGameLoopInterval(
float fInterval);
351 static bool CreateProcess(
const char* lpApplicationName,
const char* lpCommandLine,
bool bWaitOnReturn);
376 static bool ShellExecute(
const char* lpOperation,
const char* lpFile,
const char* lpParameters,
const char* lpDirectory,
int nShowCmd);
388 static bool OpenFileDialog(
const object& inout);
398 static bool WriteRegStr(
const string& root_key,
const string& sSubKey,
const string& name,
const string&
value);
409 static const char* ReadRegStr(
const string& root_key,
const string& sSubKey,
const string& name);
419 static bool WriteRegDWORD(
const string& root_key,
const string& sSubKey,
const string& name, DWORD value);
429 static DWORD ReadRegDWORD(
const string& root_key,
const string& sSubKey,
const string& name);
484 int GetChildCount2(
int nColumnIndex);
486 int GetColumnCount();
498 bool IsValid()
const;
501 int GetClassID()
const;
503 const char* GetClassName()
const;
504 const char* GetClassName1()
const;
506 const char* GetClassDescription()
const;
515 void SetOrder(
int order);
522 const char* GetFieldName(
int nIndex);
529 int GetFieldIndex(
const char* sFieldname);
537 const char* GetFieldType(
int nIndex);
543 bool IsFieldReadOnly(
int nIndex);
551 const char* GetFieldSchematics(
int nIndex);
561 const char* GetSchematicsType(
int nIndex);
570 void GetSchematicsMinMax(
int nIndex,
float fMinIn,
float fMaxIn,
float& fMin,
float& fMax);
584 object GetField(
const char* sFieldname,
const object& output);
586 object GetField2(
const char* sFieldname,
lua_State* L);
589 const char* GetStringField(
const char* sFieldname);
593 double GetValueField(
const char* sFieldname,
int nIndex=0);
601 void SetField(
const char* sFieldname,
const object& input);
604 void SetStringField(
const char* sFieldname,
const char* input);
608 void SetValueField(
const char* sFieldname,
int nIndex,
double value);
612 void CallField(
const char* sFieldname);
617 void PrintObject(
const char* file);
624 bool ResetField(
int nFieldID);
632 bool InvokeEditor(
int nFieldID,
const char* sParameters);
648 object GetDynamicField(
const char* sFieldname,
const object& output);
653 object GetDynamicField_(
int nIndex,
const object& output);
658 const char* GetDynamicFieldNameByIndex(
int nIndex);
661 int GetDynamicFieldCount();
671 int SetDynamicField(
const char* sFieldname,
const object& input);
672 int SetDynamicField_(
int nFieldIndex,
const object& input);
674 int GetFieldKeyNums(
const char* sFieldname);
675 void SetFieldKeyNums(
const char* sFieldname,
int nKeyNum);
677 void SetFieldKeyTime(
const char* sFieldname,
int nKeyIndex,
int nTime);
678 int GetFieldKeyTime(
const char* sFieldname,
int nKeyIndex);
680 void SetFieldKeyValue(
const char* sFieldname,
int nKeyIndex,
const object& input);
681 object GetFieldKeyValue(
const char* sFieldname,
int nKeyIndex,
const object& output);
684 void RemoveAllDynamicFields();
689 int AddDynamicField(
const std::string& sName,
int dwType);
708 static bool LoadFromFile(
const char* sXMLfile);
714 static bool SaveToFile(
const char* sXMLfile);
717 static void LoadDefault();
723 static const char* GetMainLoopFile();
728 static void SetMainLoopFile(
const char* sMainFile);
service logger
Definition: ParaScriptingGlobal.h:135
ParaGlobal namespace contains a list of HAPI functions to access the boot strapper functionality...
Definition: ParaScriptingGlobal.h:700
an attribute class is a collection of attribute fields.
Definition: AttributeClass.h:10
different physics engine has different winding order.
Definition: EventBinding.h:32
this is for luabinding a pointer object on lua stack, instead of invoking new operator each time an o...
Definition: ParaScriptingGlobal.h:28
ParaObject class: it is used to control game scene objects from scripts.
Definition: ParaScriptingScene.h:56
Definition: ParaScriptingGlobal.h:120
double GetSysDateTime()
Get the system date and time in seconds.
Definition: ParaTime.cpp:302
ParaGlobal namespace contains a list of HAPI functions to globally control the engine.
Definition: ParaScriptingGlobal.h:184
Definition: minilua.c:461
Definition: PEtypes.h:507
Definition: enum_maker.hpp:46
it represents an attribute object associated with an object.
Definition: ParaScriptingGlobal.h:458
A common interface for all classes implementing IAttributeFields By implementing this class's virtual...
Definition: IAttributeFields.h:59
std::string GetDateFormat(const char *sFormat)
get the date in string [thread safe]
Definition: ParaTime.cpp:117
std::string GetTimeFormat(const char *sFormat)
get the time in string [thread safe]
Definition: ParaTime.cpp:200
for luabind, The main drawback of this approach is that the compilation time will increase for the fi...
Definition: luaSQLite.cpp:1971
for a dynamic attribute field.
Definition: DynamicAttributeField.h:11
it represents a GUI object.
Definition: ParaScriptingGUI.h:104
for Para Script global dictionary object
Definition: ParaScriptingGlobal.h:99
T * get_pointer(T const &pointer)
this defines a rule, so that every object defined in ParaScripting namespace will be treated as Stack...
Definition: ParaScriptingGlobal.h:78