// TEdgeGroup - [2022-03-03 11:42:46]
#ifndef _TEDGEGROUP_H_
#define _TEDGEGROUP_H_

#include "common.h"
#include "FTTVector.h"
#include "FTTPair.h"
#include "CRSplineF.h"
/*
00199300 TEdgeGroup::TEdgeGroup(void)
001a5d70 TEdgeGroup::TEdgeGroup(TEdgeGroup const&)
001a5af2 TEdgeGroup::operator=(TEdgeGroup&&)
001a5ad6 TEdgeGroup::operator=(TEdgeGroup const&)
001a5e58 TEdgeGroup::swap(TEdgeGroup&, TEdgeGroup&)
*/

// sizeof:0x30
struct TAnalyticsEventParams {
  wchar_t* pwstr_id_0;
  int* field_4;
  int* field_8;
  int* field_c;

  double field_10;
  double field_18;
  int field_20;
  int field_24;
  int field_28;
  int field_2c;

  // 0011971C
  void FreeMembers() {
  }

  // 001F8EF8
  TAnalyticsEventParams& operator=(TAnalyticsEventParams const& obj);
};

// sizeof:0x40
struct TEventInfo {
  int field_0;
  int field_4;
  TAnalyticsEventParams EventParam_8;
  TPoint point_38;

  // 001F9296
  TEventInfo& operator=(TEventInfo const& obj);
  // 001f92b6
  TEventInfo& operator=(TEventInfo&& obj);
};

// sizeof:0x58
class TEdgeGroup {
public:
  TEdgeGroup();                                // 00199300
  TEdgeGroup(TEdgeGroup const&);               // 001a5d70
  TEdgeGroup& operator=(TEdgeGroup&&);         // 001A5AF2
  TEdgeGroup& operator=(TEdgeGroup const&);    // 001a5ad6
  static void swap(TEdgeGroup&, TEdgeGroup&);  // 001a5e58

  FTTVector<FTTPair<uint, uint>> vec_00;
  int field_14;
  int field_18;
  int field_1C;
  uint ui_20;

  __attribute__((packed)) __attribute__((aligned(1))) double dbl_24;  //???
  __attribute__((packed)) __attribute__((aligned(1))) double dbl_2C;
  int field_34;

  double dbl_38;
  int field_40;

  __attribute__((packed)) __attribute__((aligned(1))) double dbl_44;
  int field_4C;

  int field_50;
  char c_54;
  char field_55;
  short sh_56;
};

/*
001A5D8C HeightSort::operator()(TEdgeGroup const&,TEdgeGroup const&)
*/

class HeightSort {
public:
  // int operator()(TEdgeGroup *,TEdgeGroup *);			//001A5D8C
};

///////////////////////////////////////////////////////
enum eScaleX : uint {
  eScaleX_0 = 0,
  eScaleX_1,
  eScaleX_2,
  eScaleX_3,
  eScaleX_4,
};
enum eScaleY : uint {
  eScaleY_0 = 0,
  eScaleY_1,
  eScaleY_2,
  eScaleY_3,
  eScaleY_4,
};
enum ePosTypeX : uint {
  ePosTypeX_0 = 0,
  ePosTypeX_1,
  ePosTypeX_2,
  ePosTypeX_3,
  ePosTypeX_4,
};
enum ePosTypeY : uint {
  ePosTypeY_0 = 0,
  ePosTypeY_1,
  ePosTypeY_2,
  ePosTypeY_3,
  ePosTypeY_4,
};
enum EAdElPrimitive : uint {
  EAdElPrimitive_0 = 0,
  EAdElPrimitive_1,
  EAdElPrimitive_2,
  EAdElPrimitive_3,
  EAdElPrimitive_4,
};

enum eAlignmentX : uint {
  eAlignmentX_0 = 0,
  eAlignmentX_1,
  eAlignmentX_2,
  eAlignmentX_3,
  eAlignmentX_4,
};
enum eAlignmentY : uint {
  eAlignmentY_0 = 0,
  eAlignmentY_1,
  eAlignmentY_2,
  eAlignmentY_3,
  eAlignmentY_4,
};

///////////////////////////////////////////////////////
// sizeof:???
class TAdFloatInterpolator {
public:

  virtual ~TAdFloatInterpolator() {};
  virtual void GetValue(uint, float) = 0;
  virtual void Clone(void) = 0;
};
///////////////////////////////////////////////////////
// sizeof:0xC
class TAdPointInterpolator {
public:
  // vtbl:00323370
  virtual ~TAdPointInterpolator() {}  // 00195A50 00195B68
  virtual void GetValue(TPointF, float) = 0;
  virtual void Clone() = 0;
  virtual void ScaleXToY(){LOGE("Clone");};
  virtual void ScaleYToX(){LOGE("Clone");};
  virtual void ScaleXToW(float){LOGE("Clone");};
  virtual void ScaleYToH(float){LOGE("Clone");};
  virtual void ScaleXToRatio(float){LOGE("Clone");};
  virtual void ScaleYToRatio(float){LOGE("Clone");};
  TPointF pointf_04;
};
///////////////////////////////////////////////////////
//0x18
struct TAdPointEaser:TAdPointInterpolator{
 virtual void GetValue(TPointF, float){return ;};
  virtual void Clone(){LOGE("Clone");};
  
  //TPointF pointf_4;
   short field_c;
  short field_e;
  int i_10;
};

///////////////////////////////////////////////////////
//0x18
struct TAdPointSpline:TAdPointInterpolator
{
  virtual ~TAdPointSpline(){
    if(prsplinef_10)
    
    delete prsplinef_10;
  }
  virtual void GetValue(TPointF, float){return ;};
  virtual void Clone(){LOGE("Clone");};
  virtual void ScaleXToY(){LOGE("Clone");};
  virtual void ScaleYToX(){LOGE("Clone");};
  virtual void ScaleXToW(float){LOGE("Clone");};
  virtual void ScaleYToH(float){LOGE("Clone");};
  virtual void ScaleXToRatio(float){LOGE("Clone");};
  virtual void ScaleYToRatio(float){LOGE("Clone");};
  // float f_4;
  // float f_8;
  short field_c;
  short field_e;
  CRSplineF*prsplinef_10;
  float f_14;
};


///////////////////////////////////////////////////////
// sizeof:???
class TAdColourInterpolator {
public:
  // vtbl:003233E8
  virtual ~TAdColourInterpolator() {}
  virtual void GetValue(uint, float) = 0;
  virtual void Clone(void) = 0;
};

///////////////////////////////////////////////////////
// sizeof:0x18(0x10,0x10)
// T1:TPointF uint float
// T2:TAdPointInterpolator
template <class T1, class T2>
class CAdAttribute {
public:
  CAdAttribute(T1 a1, uchar a2){
    LOGE("%x",this);
    mem_00=a1; mem_08=a1;cLen_15=a2;
  };  // 00192474 00192A08 00192E98
  CAdAttribute(){};
  T1 mem_00;
  T1 mem_08;

  TAdPointInterpolator** pBuf_10;
  char c_14;
  char cLen_15;
  char c16;
  char c17;
  char c18;
};
///////////////////////////////////////////////////////
// sizeof:0x30
class CAdElement {
public:
  // vtbl:00323280
  virtual ~CAdElement() {}               // 00195FCC  00194E74
  virtual void SetAttributes(ushort) {}  // 00194E76
  virtual void Render(float, float) = 0;
  virtual void RenderAll(float, float, bool, bool) {}                        // 00194EB0
  virtual void GetExtremes(float, float, float&, float&, float&, float&) {}  // 0019500C
  virtual void Clone(void) = 0;
  virtual void Position(void) {}             // 00195086
  virtual void Scale(void) {}                // 001950B2
  virtual void Change(CFTTXmlReaderNode) {}  // 00193134

  // 00193330
  void SetName(char const*);

  CAdAttribute<TPointF, TAdPointInterpolator>* attPos_4;
  CAdAttribute<TPointF, TAdPointInterpolator>* attSize_8;
  CAdAttribute<unsigned int, TAdColourInterpolator>* attColor_C;
  CAdAttribute<float, TAdFloatInterpolator>* attLen_10;  // 此类型是猜的
  eAlignmentX eAlignmentX_14;
  eAlignmentY eAlignmentY_18;
  eScaleX eScaleX_1C;
  eScaleY eScaleY_20;
  ePosTypeX ePosTypeX_24;
  ePosTypeY ePosTypeY_28;
  bool b2C;
  char field_2D;
  char field_2E;
  char field_2F;
};
///////////////////////////////////////////////////////
// sizeof:0x30
class CAdElCircle : public CAdElement {
public:
  // vtbl:00323490
  virtual ~CAdElCircle() {}             // 0019622C
  virtual void Render(float, float) {}  // 0019623C
  virtual void Clone(void) {}           // 001962CC
};
///////////////////////////////////////////////////////
// sizeof:0x30
class CAdElRectangle : public CAdElement {
public:
  // vtbl:00323460
  virtual ~CAdElRectangle() {}          // 0019600C
  virtual void Render(float, float) {}  // 0019601A
  virtual void Clone(void) {}           // 00196074
};
///////////////////////////////////////////////////////
// sizeof:0x3C
class CAdElText : public CAdElement {
public:
  // 00193B28 乱写的
  CAdElText(CAdAttribute<TPointF, TAdPointInterpolator>* p1,
            CAdAttribute<TPointF, TAdPointInterpolator>* p2,
            CAdAttribute<unsigned int, TAdColourInterpolator>* p3,
            CAdAttribute<float, TAdFloatInterpolator>* p4,
            char const* name, bool b) {
    if (!b)
      return;
    b2C = b;
    attPos_4 = p1;
    attSize_8 = p2;
    attColor_C = p3;
    attLen_10 = p4;

    field_30 = rand() % 12;
    field_34 = rand() % 10;
  }

  // vtbl:00323310
  virtual ~CAdElText() {}  // 001958E0 00195910
  virtual void SetAttributes(ushort) {}
  virtual void Render(float, float) {}
  virtual void Clone(void) {}
  virtual void Change(CFTTXmlReaderNode) {}

  int field_30;
  int field_34;
  bool b_38;
  char c_39;
  char c_3A;
  char c_3B;
};
///////////////////////////////////////////////////////
// sizeof:0x38
class CAdElShape : public CAdElement {
public:
  // 乱写的
  CAdElShape() {
    attLen_10 = nullptr;
    b2C = true;
  }
  // vtbl:003232B0
  virtual ~CAdElShape(){};
  virtual void Render(float, float) {}
  virtual void Clone(void) {}
  virtual void Change(CFTTXmlReaderNode) {}

  TPointF* pPointf_30;
  char cPointCnt_34;
  char c35;
  char c36;
  char c37;
};
#endif  //_TEDGEGROUP_H_