utilityclasses.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. class ItemVariableFlags
  2. {
  3. static const int NONE = 0;
  4. static const int FLOAT = 0x0001;
  5. static const int STRING = 0x0002;
  6. static const int BOOL = 0x0004;
  7. };
  8. class CachedObjectsParams
  9. {
  10. static ref Param1<int> PARAM1_INT;//CachedObjectsParams.PARAM1_INT
  11. static ref Param1<bool> PARAM1_BOOL;//CachedObjectsParams.PARAM1_BOOL
  12. static ref Param1<float> PARAM1_FLOAT;//CachedObjectsParams.PARAM1_FLOAT
  13. static ref Param1<string> PARAM1_STRING;//CachedObjectsParams.PARAM1_STRING
  14. static ref Param2<int,int> PARAM2_INT_INT;//CachedObjectsParams.PARAM2_INT_INT
  15. static ref Param2<int,float> PARAM2_INT_FLOAT;//CachedObjectsParams.PARAM2_INT_FLOAT
  16. static ref Param2<int,string> PARAM2_INT_STRING;//CachedObjectsParams.PARAM2_INT_STRING
  17. static ref Param2<string,float> PARAM2_STRING_FLOAT;//CachedObjectsParams.PARAM2_STRING_FLOAT
  18. static ref Param2<string,string> PARAM2_STRING_STRING;//CachedObjectsParams.PARAM2_STRING_STRING
  19. static ref Param2<float,float> PARAM2_FLOAT_FLOAT;//CachedObjectsParams.PARAM2_STRING_STRING
  20. static void Init()
  21. {
  22. PARAM1_INT = new Param1<int>(0);
  23. PARAM1_BOOL = new Param1<bool>(false);
  24. PARAM1_FLOAT = new Param1<float>(0);
  25. PARAM1_STRING = new Param1<string>("");
  26. PARAM2_INT_INT = new Param2<int,int>(0,0);
  27. PARAM2_INT_FLOAT = new Param2<int,float>(0,0);
  28. PARAM2_INT_STRING = new Param2<int,string>(0,"");
  29. PARAM2_STRING_FLOAT = new Param2<string,float>("",0);
  30. PARAM2_STRING_STRING = new Param2<string,string>("","");
  31. PARAM2_FLOAT_FLOAT = new Param2<float,float>(0,0);
  32. }
  33. };
  34. class CachedObjectsArrays//don't forget to .Clear() your cache object before using it
  35. {
  36. static void Init()
  37. {
  38. ARRAY_STRING = new TStringArray;
  39. ARRAY_FLOAT = new TFloatArray;
  40. ARRAY_INT = new TIntArray;
  41. }
  42. static ref TStringArray ARRAY_STRING;//CachedObjectsArrays.ARRAY_STRING
  43. static ref TFloatArray ARRAY_FLOAT;//CachedObjectsArrays.ARRAY_FLOAT
  44. static ref TIntArray ARRAY_INT;//CachedObjectsArrays.ARRAY_INT
  45. };