// _TFreeControl_H_ - [2020-06-22 11:41:46]
#ifndef _TFreeControl_H_
#define _TFreeControl_H_

#include "ACT.h"
#include "global_func.h"

enum EFreePropType {
  EFreePropType_0,
  EFreePropType_1,
  EFreePropType_2,
  EFreePropType_3,
  EFreePropType_4,
  EFreePropType_5,
};

struct TAnim {
  int m_iTick_0;
  int m_iAnimID_4;
  int m_iRot_8;
};

// sizeof(TDest) == 0x1C
struct TFreeMoveInfo {
  int       m_iTick_0;           
  TPoint    m_tDestPoint_4;      
  int       m_iFace_C;           
  int       m_iUrgency_10;       
  TPoint    m_tMoveInfluence_14;
};

// sizeof = 0x548
struct TFreePlayer
{
  int filed_0;
  TPoint m_tPoint_4;
  int m_iHoldPosTime_C;
  int m_iRot_10;
  bool m_iTeamMoveInfluence_14;
  TPoint m_tPoint_18;
  int m_iMoveResponseTime_20;
  int m_iKickResponseTime_24;
  bool m_bStatic_28;
  int m_iNodeTDestSetLoopIndex_2C;
  TFreeMoveInfo m_tPlayerDesk_30[32];
  int m_iNodeAnimSetLoopIndex_3B0;
  TAnim m_tAnim_3B4[32];
  int m_iAction_534;
  int m_iActionPassTarget_538;
  int m_iActionControlCount_53C;
  int m_iActionControlRot_540;
  float m_fActionControlKickAhead_544;
};

struct TMoveInfluence {
  TPoint      m_tMoveInfluencePoint_0;
  int         m_iMoveInfluenceDelayMin_8;
  int         m_iMoveInfluenceDelayMax_C;
};

struct TFreeProp {
  TPoint3D    m_tPoint3D_0;
  EFreePropType   m_iType_C;
  int         m_iRot_10;
};

//0x7634
struct TFreeGoal {
  int         m_iVersion_0;
  float       m_f_4;
  int         m_iWeather_8;
  int         m_iMaxPhaseCount_C;
  bool        m_bIndirect_10;
  int         m_iTeamPlayerIndex_14[2]; // 14 遍历两只球队成员node对象时用到的计数器跳出循环时的值
                                        // 18
  TFreePlayer   m_tTeamPlayerInfo_1C[2][11];     // 0x3A18 * 2; 0x548 * 0xB
  TPoint3D    m_tBallPos_744C;    
  int         m_iUserPlayer_7458;
  int         m_iKickPlayer_745C;
  int         m_iAnimID_7460;
  int         m_iKickRot_7464;
  int         m_iShotAnimID_7468;
  int         m_iShotAnimPlayer_746C;
  float       m_fShotAnimDistance_7470;
  int         m_iTEAMMoveResponseTime_7474;
  int         m_iTEAMKickResponseTime_7478;
  int         m_iCPUPlayerCloseDownCount_747C;
  float       m_fCPUCloseDownDist_7480;
  int         m_iCPUGKRating_7484;
  int         m_fCPUGKSaveAlwaysDistance_7488;
  int         m_iCPUGKSaveResponseTime_748C;
  float       m_fCPUGKSaveSpeed_7490;
  float       m_fCPUGKSaveDistance_7494;
  int         m_iCPUGKPosResponseTime_7498;
  int         m_iCPUKickResponseTime_749C;
  int         m_iCPUMoveResponseTime_74A0;
  TMoveInfluence m_tMoveInfluence_74A4[2];
  float       m_fTEAMPassForceShotDist_74C4;
  float       m_fTEAMPassForceShotSpace_74C8;
  int         m_iShootBias_74CC;
  int         m_iShootScale_74D0;
  int         m_iPassBias_74D4;
  int         m_iPassScale_74D8;
  int         m_iControlWhenShootBias_74DC;
  int         m_iControlWhenShootScale_74E0;
  int         m_iControlWhenPassBias_74E4;
  int         m_iControlWhenPassScale_74E8;
  int         m_iControlRepeatReduce_74EC;
  int         m_iPropCount_74F0;
  TFreeProp   m_tFreeProp_74F4[16]; // 数组
};

//sizeof:0x410
class TFreeControl {
public:
  TFreeControl& operator=(TFreeControl const&); //001D5E10
  CPlayer* m_pPlayer_0;             
  TKickSetup field_4;
  TPoint PointArr_1C[120];          
  int cBuff_3DC[9];               
  int field_400;                    
  int field_404;                    
  int field_408;                    
  int field_40C;                    
};

struct TFreeInfo_0
{
  bool b_0;
  bool b_1;
  bool b_2;
  bool b_3;
  bool uc_4;
  bool uc_5;
  uchar uc_6;
  uchar unuse_7;
  bool b_8;
  bool b_9;
  bool b_A;
  bool b_B;
  bool b_C;
  uchar uc_D;
  uchar uc_E;
  uchar uc_F;
  int field_10;
  int field_14[1536];
  int field_1814;
  TFreeGoal *pFREE_tGoal_1818;  //此处是FREE_tGoal的指针
  int field_181C;
  int field_1820;
  int field_1824;
  uint ugamestatus_1828;                 //这个变量应该表示游戏的状态
  int field_182C;
  int field_1830;
  int field_1834;
  int field_1838;
  uchar field_183C[4];
  int field_1840;
  int field_1844;
  TPoint field_1848;
  int field_1850;
  int field_1854;
  int field_1858;
  short field_185C;
  char field_185E;
  int field_1860;
  int field_1864;
};

struct TFreeInfo_1C9C{
  char field_1C9C;
  int field_1CA0;
  char field_1CA4;
  int field_1CA8;
  int field_1CAC;
  char field_1CB0;//001D57E6 LDRB R0, [R5,R0] 001D41C2 STRH R4, [R6,R1],可能有两种数据类型
  char field_1CB1;
  TPoint3D  m_pt3D_1CB4;
  TPoint3D m_pt3D_1CC0;
  int field_1CCC;
  int field_1CD0;
  int field_1CD4;
  int field_1CD8;
  int field_1CDC;
  int field_1CE0;
  int field_1CE4;
  int field_1CE8;
  int field_1CEC;
  int field_1CF0;
  uchar field_1CF4;
  uchar field_1CF5;
  uchar field_1CF6;
  uchar field_1CF7;
  int m_iCPUPlayerCloseDownCount_1CF8;
  float m_fCPUCloseDownDist_1CFC;
  int m_iCPUGKRating_1D00;
  float m_fCPUGKSaveAlwaysDistance_1D04;
  int m_iCPUGKSaveResponseTime_1D08;
  float m_fCPUGKSaveSpeed_1D0C;
  float m_fCPUGKSaveDistance_1D10;
  int m_iCPUGKPosResponseTime_1D14;
  int m_iCPUKickResponseTime_1D18;
  int m_iCPUMoveResponseTime_1D1C;
};

/*
001D59AC TFreeInfo::operator=(TFreeInfo const&);
*/
//sizeof:0x1D20
class TFreeInfo {
public:
  TFreeInfo& operator=(TFreeInfo const&);  //001D59AC
  TFreeInfo_0 filed_0;
  int field_1868;
  int field_186C;
  TPoint field_1870;
  int field_1878;
  int field_187C;
  int field_1880;
  int field_1884;
  int field_1888;
  TFreeControl field_188C;
  TFreeInfo_1C9C field_1C9C;
};


#endif  //_CAM_H_