1
Fork 0
This repository has been archived on 2025-04-09. You can view files and clone it, but cannot push or open issues or pull requests.
beats-motor-client/src/ai_world.cpp
2013-04-16 15:29:55 +02:00

25 lines
495 B
C++

#include "ai_world.hpp"
#include <motor/basic/body.hpp>
#include "physics.hpp"
#include <motor/basic/scene.hpp>
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<Body> b){
astrant::append(bodies, {b});
}
void AIWorld::remove(std::shared_ptr<Body> b){
astrant::remove_element(bodies, b);
}
}