Undone changes to main
This commit is contained in:
parent
1f6f51877a
commit
f8571b36bd
35
src/Main.cpp
35
src/Main.cpp
@ -4,39 +4,6 @@
|
||||
|
||||
using namespace farmlands;
|
||||
|
||||
#include <utils/QTree.h>
|
||||
|
||||
void qtreeTest()
|
||||
{
|
||||
utils::RectF bounds(0, 0, 100, 100);
|
||||
utils::QTree<std::string, 10> tree(bounds);
|
||||
|
||||
Assert(tree.empty(), "Tree should be empty.");
|
||||
Assert(tree.size() == 0, "Tree should be empty.");
|
||||
srand(10);
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
tree.insert("Random", rand() % 100, rand() % 100);
|
||||
}
|
||||
|
||||
Assert(!tree.empty(), "Tree should be empty.");
|
||||
Assert(tree.size() == 100, "Tree should be empty.");
|
||||
|
||||
while (tree.size() > 2)
|
||||
tree.erase(tree.begin());
|
||||
|
||||
utils::RectF search(-10, -10, 120, 120);
|
||||
for (auto it = tree.lower_bound(search); it != tree.upper_bound(search); it++)
|
||||
std::cout << it->data << ": " << it->x << ", " << it->y << "\n";
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
qtreeTest();
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
int main()
|
||||
{
|
||||
int ret = 0;
|
||||
@ -64,5 +31,3 @@ int main()
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user