// // Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #pragma once #include "td/telegram/MessageFullId.h" #include "td/telegram/td_api.h" #include "td/telegram/telegram_api.h" #include "td/telegram/UserId.h" #include "td/actor/actor.h" #include "td/utils/common.h" #include "td/utils/Promise.h" namespace td { class Td; class GameManager final : public Actor { public: GameManager(Td *td, ActorShared<> parent); GameManager(const GameManager &) = delete; GameManager &operator=(const GameManager &) = delete; GameManager(GameManager &&) = delete; GameManager &operator=(GameManager &&) = delete; ~GameManager() final; void set_game_score(MessageFullId message_full_id, bool edit_message, UserId user_id, int32 score, bool force, Promise> &&promise); void get_game_high_scores(MessageFullId message_full_id, UserId user_id, Promise> &&promise); td_api::object_ptr get_game_high_scores_object( telegram_api::object_ptr &&high_scores); private: void tear_down() final; void on_set_game_score(MessageFullId message_full_id, Promise> &&promise); Td *td_; ActorShared<> parent_; }; } // namespace td