blob: ec608b5e3d627f52c8bbb8a39adea65d077fc431 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#include <memory>
#include "CollisionContext.h"
#include "Museum.h"
#include "NaiveCollisionChecker.h"
#include "QuadTreeCollisionChecker.h"
using namespace std;
CollisionContext::CollisionContext(Museum & m) : museum(m) {}
shared_ptr<CollisionChecker> CollisionContext::get_checker() {
return this->checker;
}
void CollisionContext::update() {
this->checker = std::make_shared<QuadTreeCollisionChecker>(this->museum);
// this->checker = std::make_shared<NaiveCollisionChecker>(this->museum);
this->checker->check();
}
|