// CHeroAnalytics.h - [2022-04-08 18:44:26]
#ifndef _CHEROANALYTICS_H_
#define _CHEROANALYTICS_H_

#include "common.h"

/*
00119320 CHeroAnalytics::Init()
0011942C CHeroAnalytics::AdjustSuccesfulTransactionCB()
0011942E CHeroAnalytics::AdjustFailedTransactionCB()
001194AC CHeroAnalytics::UserProgressCB(double &)
001194D4 CHeroAnalytics::UserTypeCB(double &)
001194F8 CHeroAnalytics::UserGroupCB(double &)
0011951C CHeroAnalytics::UserIDCB(double &)
0011953C CHeroAnalytics::PurchaseCountCB(double &)
0011955C CHeroAnalytics::TotalRevenueCB(double &)
0011957C CHeroAnalytics::InstallTimestampCB(ulong long &)
0011959C CHeroAnalytics::InstallSourceTrackerCB()
001195B0 CHeroAnalytics::InstallSourceCampaignCB()
001195C4 CHeroAnalytics::LogSignInEvent()
001196C8 CHeroAnalytics::LogEvent(EAnalyticsEvent,TAnalyticsEventParams const*)
0011974C CHeroAnalytics::SetInstallSourceParams(char const*,char const*)
00119794 CHeroAnalytics::NotificationAppLaunched(char const*,char const*,char const*)
0011984C CHeroAnalytics::EnableAdjust(bool)
001198C8 CHeroAnalytics::LoggingEnabled()
001198F4 CHeroAnalytics::Shutdown()
00119990 CHeroAnalytics::GetSkillNameInEnglish(wchar_t *,int,int)
001199C0 CHeroAnalytics::LogUserABType()
*/


enum EAnalyticsEvent {
  EAnalyticsEvent_Neg = -1,
  EAnalyticsEvent_0,
  EAnalyticsEvent_1,
  EAnalyticsEvent_2,
  EAnalyticsEvent_3,
  EAnalyticsEvent_4,
  EAnalyticsEvent_5,
  EAnalyticsEvent_6,
  EAnalyticsEvent_7,
  EAnalyticsEvent_8,
  EAnalyticsEvent_9,
  EAnalyticsEvent_10,
  EAnalyticsEvent_11,
  EAnalyticsEvent_12,
};

struct NPoint {
  int dx_0;
  int dy_4;

  void Init(int x, int y) {
    dx_0 = x;
    dy_4 = y;
  };
};

// sizeof = 0x30
struct TAnalyticsEventParams {
  // uint64_t ll_0;
  // uint64_t ll_8;
  wchar_t*pw_0;
  wchar_t*pw_4;
  wchar_t*pw_8;
  wchar_t*pw_c;
  
  union u_10{
    double db_10;
    struct t_10{
      int i_10;
      int i_14;
    }t_ii_10;
  }uo_10;
  
  union u_18{
    double db_18;
    struct t_108{
      int i_18;
      int i_1c;
    }t_ii_18;
  }uo_18;
   union u_20{
    double db_20;
    struct t_20{
      int i_20;
      int i_24;
    }t_ii_20;
  }uo_20;
 union u_28{
    double db_28;
    struct t_28{
      int i_28;
      int i_2c;
    }t_ii_28;
  }uo_28;
  void FreeMembers(){
    LOGE("%x%x%x",rand(),this,pw_0);
  }
};

class CHeroAnalytics {
public:
  __attribute__((noinline)) static void Init();                                                             // 00119320
  __attribute__((noinline)) static void AdjustSuccesfulTransactionCB();                                     // 0011942C
  __attribute__((noinline)) static void AdjustFailedTransactionCB();                                        // 0011942E
  __attribute__((noinline)) static void UserProgressCB(double &);                                           // 001194AC
  __attribute__((noinline)) static void UserTypeCB(double &);                                               // 001194D4
  __attribute__((noinline)) static void UserGroupCB(double &);                                              // 001194F8
  __attribute__((noinline)) static void UserIDCB(double &);                                                 // 0011951C
  __attribute__((noinline)) static void PurchaseCountCB(double &);                                          // 0011953C
  __attribute__((noinline)) static void TotalRevenueCB(double &);                                           // 0011955C
  __attribute__((noinline)) static void InstallTimestampCB(uint64 &);                                       // 0011957C
  __attribute__((noinline)) static void InstallSourceTrackerCB();                                           // 0011959C
  __attribute__((noinline)) static void InstallSourceCampaignCB();                                          // 001195B0
  __attribute__((noinline)) static void LogSignInEvent();                                                   // 001195C4
  __attribute__((noinline)) static void LogEvent(EAnalyticsEvent a1, TAnalyticsEventParams const *a2){
    LOGE("%x%x%x%x,",a1,a2,a2->pw_0,a2->pw_4);
    for(int i=0;i<0x30;i++){
      LOGE("%x",((int*)a2)[i]);
    }
  }           // 001196C8
  __attribute__((noinline)) static void SetInstallSourceParams(char const *, char const *);                 // 0011974C
  __attribute__((noinline)) static void NotificationAppLaunched(char const *, char const *, char const *);  // 00119794
  __attribute__((noinline)) static void EnableAdjust(bool);                                                 // 0011984C
  __attribute__((noinline)) static void LoggingEnabled();                                                   // 001198C8
  __attribute__((noinline)) static void Shutdown();                                                         // 001198F4
  __attribute__((noinline)) static void GetSkillNameInEnglish(wchar_t *, int, int);                         // 00119990
  __attribute__((noinline)) static void LogUserABType();                                                    // 001199C0
};

#endif  //_CHEROANALYTICS_H_