19 #include "gpg/achievement_manager.h"
20 #include "gpg/player_manager.h"
21 #include "gpg/types.h"
26 enum RequestState { kPending, kComplete, kFailed };
38 bool Initialize(
bool ui_login);
51 std::string leaderboard;
57 void IncrementEvent(
const char *event_id, uint64_t score);
59 void ShowLeaderboards(
const GPGIds *ids,
size_t id_len);
60 void ShowAchievements();
67 void FetchAchievements();
73 RequestState event_data_state()
const {
return event_data_state_; }
75 std::map<std::string, gpg::Event> &event_data() {
return event_data_; }
77 gpg::Player *player_data()
const {
return player_data_.get(); }
79 uint64_t GetEventValue(std::string event_id);
80 bool IsAchievementUnlocked(std::string achievement_id);
81 void UnlockAchievement(std::string achievement_id);
82 void IncrementAchievement(std::string achievement_id);
83 void IncrementAchievement(std::string achievement_id, uint32_t steps);
84 void RevealAchievement(std::string achievement_id);
103 std::unique_ptr<gpg::GameServices> game_services_;
105 void UpdatePlayerStats();
109 bool event_data_initialized_;
110 bool achievement_data_initialized_;
111 RequestState event_data_state_;
112 RequestState achievement_data_state_;
113 static pthread_mutex_t events_mutex_;
114 static pthread_mutex_t achievements_mutex_;
115 static pthread_mutex_t players_mutex_;
116 std::map<std::string, gpg::Event> event_data_;
117 std::unique_ptr<gpg::Player> player_data_;
118 std::vector<gpg::Achievement> achievement_data_;
123 #endif // GPG_MANAGER_H
Definition: gpg_manager.h:50
Definition: gpg_manager.h:28
Definition: gpg_manager.h:33