serial.hpp 838 B

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // serial.hpp
  3. // danmaku
  4. //
  5. // Created by Sam Jaffe on 5/27/19.
  6. // Copyright © 2019 Sam Jaffe. All rights reserved.
  7. //
  8. #pragma once
  9. #include <memory>
  10. #include <json/forwards.h>
  11. #include "game/engine/serial.hpp"
  12. namespace danmaku {
  13. class actor;
  14. class player;
  15. struct points_map;
  16. }
  17. namespace graphics {
  18. class manager;
  19. }
  20. namespace danmaku {
  21. points_map to_points_map(Json::Value const & json);
  22. std::unique_ptr<actor> to_actor(Json::Value const & json,
  23. graphics::manager const & mgr);
  24. std::unique_ptr<player> to_player(Json::Value const & json,
  25. graphics::manager const & mgr);
  26. template <typename F, typename... Args>
  27. auto to_vector(Json::Value const & json, F && func, Args &&... args)
  28. -> std::vector<decltype(func(json, args...))>;
  29. }