-
Notifications
You must be signed in to change notification settings - Fork 26
system
laishikai edited this page Oct 7, 2021
·
3 revisions
class System
{
// 功能:返回当前系统时钟,单位是微秒(1000微秒 = 1毫秒)
public static int64 clock();
// 功能:返回当前系统时钟,单位是毫秒(1000毫秒 = 1秒)
public static int64 GetTickCount();
// 功能:设置随机函数的初始种子,相当于C函数的srand
public static void srand(uint nRandSeed);
// 功能:随机一个整数, 区间[nMin, nMax)
public static int RandInt(int nMin, int nMax);
// 功能:随机一个浮点数,区间[fMin, fMax)
public static float RandFloat(float fMin, float fMax);
// 功能:随机一个双精浮点数,区间[min, max)
public static double RandDouble(double min, double max);
// 功能:取utc时间
public static int64 time();
// 功能:取时间描述的字符串,如 xxxx-xx-xx xx:xx:xx
// 说明:将当前utc时间转换成字符串,格式如:xxxx-xx-xx xx:xx:xx
public static StringA time_desc();
// 功能:将当前时间的六个分量拷贝到一个INT数组
// a[0] = year; a[1] = month; a[2] = day; a[3] = hour; a[4] = minute; a[5] = second;
public static void TimeToArray(list<int> array);
// 功能:返回class实例ins的引用计数,调试用的接口
pulbic static int GetRef(ins);
// 功能:返回class实例ins的弱引用计数,调试用的接口
pulbic static int GetWeakRef(ins);
---------------------------------------------------------------
// 功能:开方
public static double sqrt(double fValue);
public static float sqrtf(float fValue);
public static double sin(double fValue);
public static float sinf(float fValue);
public static double cos(double fValue)
public static float cosf(float fValue);
public static double tan(double fValue);
public static float tanf(float fValue);
public static double atan(double fValue);
public static float atanf(float fValue);
public static double atan2(double y, double x);
public static float atan2f(float y, float x);
public static double asin(double fValue);
public static float asinf(float fValue);
public static double acos(double fValue);
public static float acosf(float fValue);
---------------------------------------------------------------
// 功能:读取一个文本格式的XML到脚本对象
public static bool ReadXml(_Ty pXmlRoot, const StringA &szRootName, const StringA &szFileData);
// 功能:将脚本对象转换成文本格式的XML
pulbic static bool WriteXml(_Ty pXmlRoot,const StringA &szRootName, StringA &szFileData);
// 功能:从一个二进制流中读取XML脚本对象
public static bool ReadBin( _Ty pXmlRoot, const StringA &szFileData);
// 功能:将XML脚本对象写入到二进制流
public static bool XmlToBin(_Ty pXmlRoot, StringA &szFileData);
---------------------------------------------------------------
// 功能:读取一个Json配置
public static bool ReadJson(_Ty pJsonRoot, StringA szJson);
// 功能:将Json对象转换成Json字符串
public static StringA WriteJson(_Ty pJsonRoot);
---------------------------------------------------------------
// 功能:打印到命令行
public static void print(StringA szFormat, params System.Object[] args);
---------------------------------------------------------------
// 功能:系统广播调用
public static void Broadcast(StringA szGroupName, params System.Object[] args);
// 功能:获取需要广播的类列表
public static void GetBroadstList(ref List<FCType> ClassList, StringA szFuncName);
// 功能:动态调用任意一个函数(Invoke)
public static void Call(_Ty obj, StringA szFuncName, params System.Object[] args);
};