CDataBase.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. // CDataBase - [2020-04-13 11:57:46]
  2. #ifndef _CDATABASE_H_
  3. #define _CDATABASE_H_
  4. #include "TPlayerInfoLight.h"
  5. /*
  6. 0011AB70 CDataBase::CDataBase()
  7. 0011AB78 CDataBase::~CDataBase()
  8. 0011AB48 CDataBase::GetInstance()
  9. 0011AB84 CDataBase::FreeTeams()
  10. 0011AB98 CDataBase::CalculateTiers()
  11. 0011AC70 CDataBase::GetSortedRatingListForLeague(int *,int,int,int,int &)
  12. 0011AEA4 CDataBase::GetTeamInfo(int)
  13. 0011AF04 CDataBase::LoadTeams()
  14. 0011AFE0 CDataBase::Init()
  15. 0011B00C CDataBase::Shutdown()
  16. 0011B030 CDataBase::GetTeam(int)
  17. 0011B048 CDataBase::GetTeamIndex(int)
  18. 0011B078 CDataBase::GetTeamCount()
  19. 0011B088 CDataBase::GetTeamCount(ELeague)
  20. 0011B0BC CDataBase::GetTeamCount(int)
  21. 0011B0F8 CDataBase::IsLeagueInternational(ELeague,int)
  22. 0011B116 CDataBase::IsTeamInternational(int)
  23. 0011B140 CDataBase::GetLeagueForTeamID(int)
  24. 0011B150 CDataBase::GetSortedAlphabeticalListForLeague(int,int &,int *,int,int,int,bool)
  25. 0011B37C CDataBase::GetTeamName(int,ETeamNameType)
  26. 0011B408 CDataBase::GetSortedAlphabeticalListForGivenTeams(int *,int)
  27. 0011B4B8 CDataBase::GetSortedRatingListForTier(int,int,int,int &,bool)
  28. 0011B6E8 CDataBase::GetCompetitionName(wchar_t *,int,ELeague,int)
  29. 0011B7EC CDataBase::GetCountryName(wchar_t *,int,ELeague)
  30. 0011B838 CDataBase::GetDefaultTeam(int)
  31. 0011B848 CDataBase::GetTeamIDFromLeagueWithTier(int,int,int *,int)
  32. 0011B92C CDataBase::GetXBestTeamInLeague(ELeague,int,int,int)
  33. 0011B952 CDataBase::GetXBestTeamInTier(int,int,int,int)
  34. */
  35. struct TTeamInfo_Struct_28 {
  36. char field_0[0x28];
  37. };
  38. //-------------------------------------------------------------------------------------------------
  39. enum ELeague {
  40. ELeague_neg1 = -1,
  41. ELeague_0 = 0,
  42. ELeague_1,
  43. ELeague_2,
  44. ELeague_3,
  45. ELeague_4,
  46. ELeague_5,
  47. ELeague_6,
  48. ELeague_7,
  49. ELeague_8,
  50. ELeague_9,
  51. ELeague_10,
  52. ELeague_11,
  53. ELeague_12,
  54. ELeague_13,
  55. ELeague_14,
  56. };
  57. //-------------------------------------------------------------------------------------------------
  58. enum ETeamNameType {
  59. ETeamNameType_0,
  60. ETeamNameType_1,
  61. ETeamNameType_2,
  62. ETeamNameType_3,
  63. ETeamNameType_4,
  64. ETeamNameType_5,
  65. };
  66. //-------------------------------------------------------------------------------------------------
  67. // TTeamInfo 结构体长度 0x11E0
  68. struct TTeamInfo {
  69. int index_0;
  70. ELeague dLeagueId_4;
  71. TTeamInfo_Struct_28 field_8[2];
  72. TTeamInfo_Struct_28 field_58[2];
  73. int field_A8[2];
  74. int field_B0[2];
  75. int field_B8[2];
  76. int field_C0[2];
  77. int field_C8;
  78. uchar field_CC[0xFDC];
  79. TPlayerInfoLight ptplayerInfoLight_10A8[0x10];
  80. TPlayerInfoLight tplayerInfoLight_11C8;
  81. uchar field_11DA;
  82. uchar field_11DB;
  83. int field_11DC;
  84. };
  85. //-------------------------------------------------------------------------------------------------
  86. // 0x11DC
  87. struct TTeamInfoFileNode {
  88. uchar tmp[0x11DC];
  89. };
  90. //-------------------------------------------------------------------------------------------------
  91. class CDataBase {
  92. public:
  93. // 0011AB70
  94. CDataBase();
  95. // 0011AB78
  96. ~CDataBase();
  97. // 0011AB48
  98. static CDataBase *GetInstance();
  99. // 0011AB84
  100. void FreeTeams();
  101. // 0011AB98
  102. static void CalculateTiers();
  103. // 0011AC70
  104. static ushort *GetSortedRatingListForLeague(int *a1, int a2, int a3, int a4, int &a5);
  105. // 0011AEA4
  106. static TTeamInfo *GetTeamInfo(int);
  107. // 0011AF04
  108. void LoadTeams();
  109. // 0011AFE0
  110. static void Init();
  111. // 0011B00C
  112. static void Shutdown();
  113. // 0011B030
  114. static TTeamInfo *GetTeam(int index);
  115. // 0011B048
  116. static int GetTeamIndex(int index);
  117. // 0011B078
  118. static int GetTeamCount();
  119. // 0011B088
  120. static int GetTeamCount(ELeague e);
  121. // 0011B0BC
  122. static int GetTeamCount(int d);
  123. // 0011B0F8
  124. static bool IsLeagueInternational(ELeague e, int a);
  125. // 0011B116
  126. static bool IsTeamInternational(int a);
  127. // 0011B140
  128. static ELeague GetLeagueForTeamID(int a);
  129. // 0011B150
  130. static wchar_t *GetSortedAlphabeticalListForLeague(int, int &, int *, int, int, int, bool);
  131. // 0011B37C
  132. static wchar_t *GetTeamName(int a, ETeamNameType e);
  133. // 0011B408
  134. static ushort *GetSortedAlphabeticalListForGivenTeams(int *, int);
  135. // 0011B4B8
  136. static ushort *GetSortedRatingListForTier(int a1, int a2, int a3, int &list, bool a5);
  137. // 0011B6E8
  138. static void GetCompetitionName(wchar_t *pbuf, int len, ELeague e, int ar3);
  139. // 0011B7EC
  140. static void GetCountryName(wchar_t *, int, ELeague);
  141. // 0011B838
  142. static int GetDefaultTeam(int);
  143. // 0011B848
  144. static int GetTeamIDFromLeagueWithTier(ELeague e, int a2, int *list, int count);
  145. // 0011B92C
  146. static int GetXBestTeamInLeague(ELeague, int, int, int);
  147. // 0011B952
  148. static int GetXBestTeamInTier(int, int, int, int);
  149. bool bInit_0;
  150. // int field_1;
  151. // int field_2;
  152. // int field_3;
  153. TTeamInfo *pTteamInfo_4;
  154. int dTeamCount_8;
  155. wchar_t pbuf_C[32];
  156. static CDataBase *ms_pInstance;
  157. };
  158. //-------------------------------------------------------------------------------------------------
  159. #endif //_CDATABASE_H_