//CUITileManager - [2020-04-13 11:57:47]
#ifndef _CUITILEMANAGER_H_
#define _CUITILEMANAGER_H_

#include "CUITileScroller.h"
#include "CUITile.h"

/*
00147058 CUITileManager::CUITileManager(int)
001472B4 CUITileManager::~CUITileManager()
0013AD70 CUITileManager::AddButton(EUITileAction)
0014712C CUITileManager::Reset(bool)
001472A8 CUITileManager::SetButtons(uint64_t)
001472CC CUITileManager::GetHasButton(int)
001472DE CUITileManager::UpdateButtons()
00147368 CUITileManager::AddButtonTile(EUITileAction)
00147AFC CUITileManager::RemoveTile(CUITile *)
00147B46 CUITileManager::AddTile(float,float,CUITile *,bool,float,EHUDPosition)
00147C10 CUITileManager::ClearHighlights()
00147C2E CUITileManager::RemoveTiles(CUITile *)
00147CA8 CUITileManager::Process(bool,int *)
0014831C CUITileManager::AddDressing(EUIDressingType,EUIDressingPos,float,float,float)
00148358 CUITileManager::UpdateDressingPosition(EUIDressingType,EUIDressingPos,float,float,float)
00148398 CUITileManager::RenderBackground()
001483DC CUITileManager::SortTiles()
001483F4 CUITileManager::Render()
0014869C CUITileManager::RenderHUD()
00148858 CUITileManager::IncreaseMemory(int)
001488EE CUITileManager::AddTileWithRotation(float,float,CUITile *,CUITile *,bool,float)
00148920 CUITileManager::AddTileWithRotation(float,float,CUITile *,float,float,float,bool,float)
00148978 CUITileManager::GetPositionFromRotation(float &,float &,float,float,float)
00148A00 CUITileManager::BringTileToFront(CUITile *)
00148A44 CUITileManager::UpdateScreenSize()
00148AA0 CUITileManager::EnableAllTiles(bool)

0xB50
*/

enum EUIDressingType {
  EUIDressingType_0,
  EUIDressingType_1,
  EUIDressingType_2,
  EUIDressingType_3,
  EUIDressingType_4,
  EUIDressingType_5,
};

enum EUIDressingPos {
  EUIDressingPos_0,
  EUIDressingPos_1,
  EUIDressingPos_2,
  EUIDressingPos_3,
  EUIDressingPos_4,
  EUIDressingPos_5,
};

//0x14
struct TDressing {
  EUIDressingType eType_0;  //148
  EUIDressingPos ePos_4;    //14C
  float f_8;                //150
  float f_C;                //154
  float f_10;               //158
};

class CUITileManager {
public:
  CUITileManager(int a1);                                                               //00147058
  ~CUITileManager();                                                                    //001472B4
  void AddButton(EUITileAction);                                                        //0013AD70
  void Reset(bool);                                                                     //0014712C
  void SetButtons(uint64_t);                                                            //001472A8
  bool GetHasButton(int);                                                               //001472CC
  void UpdateButtons();                                                                 //001472DE
  void AddButtonTile(EUITileAction) __attribute__((noinline));                          //00147368
  void RemoveTile(CUITile *);                                                           //00147AFC
  void AddTile(float, float, CUITile *, bool, float, EHUDPosition);                     //00147B46
  void ClearHighlights();                                                               //00147C10
  void RemoveTiles(CUITile *);                                                          //00147C2E
  EUITileAction Process(bool b1, int *pa2);                                             //00147CA8
  void AddDressing(EUIDressingType, EUIDressingPos, float, float, float);               //0014831C
  void UpdateDressingPosition(EUIDressingType, EUIDressingPos, float, float, float);    //00148358
  void RenderBackground();                                                              //00148398
  void SortTiles();                                                                     //001483DC
  void Render();                                                                        //001483F4
  void RenderHUD();                                                                     //0014869C
  void IncreaseMemory(int);                                                             //00148858
  void AddTileWithRotation(float, float, CUITile *, CUITile *, bool, float);            //001488EE
  void AddTileWithRotation(float, float, CUITile *, float, float, float, bool, float);  //00148920
  static void GetPositionFromRotation(float &f0,
                                      float &f1,
                                      float f2,
                                      float f3,
                                      float f4);  //00148978

  void BringTileToFront(CUITile *);  //00148A00
  void UpdateScreenSize();           //00148A44
  void EnableAllTiles(bool);         //00148AA0

  uint dIndex_0;  //计数器
  int *l_int_4;
  CUITile **ppCUITile_8;
  CUITile *pTile_C[31];
  int dCount_88;
  int dCount_8C;
  uint64_t ull_90; //??? 此处 001473DE 显示90位置是一个int
  uint64_t ull_98;
  int field_A0;
  int field_A4;
  CUITile *pTile_A8;
  CUITileScroller tTileScroller_AC;
  CUITileScroller tTileScroller_F4;
  uchar uy_13C;
  uchar uy_13D;
  bool b_13E;
  bool b_13F;

  uchar uy_140;
  uchar uy_141;
  uchar uy_142;
  uchar uy_143;
  int dIndexDressing_144;
  TDressing l_Dressing_148[128];
  volatile int field_B48;
  int field_B4C;

  static int UITILE_SCROLLBARW;  //0033659C
  static float m_fTileScale;     //003365A0
  static int UITILE_ADBAR_H;     //00352E20
};

#endif  //_CUITILEMANAGER_H_