#include "ai_world.hpp" #include #include "physics.hpp" #include namespace motor { void AIWorld::update(float dt, Input& input, World& world){ auto bodies_copy = bodies; for(auto& b : bodies_copy){ if(b->ai){ b->ai->update(dt, {*b, input, world}); } } } void AIWorld::add(std::shared_ptr b){ astrant::append(bodies, {b}); } void AIWorld::remove(std::shared_ptr b){ astrant::remove_element(bodies, b); } }