serial.hpp 692 B

123456789101112131415161718192021222324252627282930313233
  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. struct points_map;
  15. }
  16. namespace graphics {
  17. class manager;
  18. }
  19. namespace danmaku {
  20. points_map to_points_map(Json::Value const & json);
  21. std::unique_ptr<actor> to_actor(Json::Value const & json,
  22. graphics::manager const & mgr);
  23. template <typename F, typename... Args>
  24. auto to_vector(Json::Value const & json, F && func, Args &&... args)
  25. -> std::vector<decltype(func(json, args...))>;
  26. }