enemy.cxx 555 B

1234567891011121314151617181920212223
  1. //
  2. // enemy.cxx
  3. // danmaku
  4. //
  5. // Created by Sam Jaffe on 5/26/19.
  6. // Copyright © 2019 Sam Jaffe. All rights reserved.
  7. //
  8. #include "danmaku/enemy.hpp"
  9. #include <json/json.h>
  10. #include "danmaku/bullet_pattern.hpp"
  11. #include "resource_factory/prototype_factory.hpp"
  12. using namespace danmaku;
  13. points_map to_points_map(Json::Value const & json) {
  14. return {json["damage"].asInt(), json["kill"].asInt()};
  15. }
  16. enemy::enemy(Json::Value const & json, graphics::object const & obj)
  17. : actor(json, obj), points_(to_points_map(json["points"])), attack_() {}