Fix Intersect and add sort the list each time we add something to it.

This commit is contained in:
Godzil
2020-02-20 00:46:19 +00:00
parent a82b67faa4
commit dbaa6eea2c
2 changed files with 30 additions and 8 deletions

View File

@@ -15,14 +15,15 @@
class Intersect
{
private:
Intersection *list;
Intersection **list;
uint32_t num;
uint32_t allocated;
public:
Intersect();
~Intersect();
void add(Intersection i);
int count() { return this->num; };
Intersection operator[](const int p) { return this->list[p]; }
Intersection operator[](const int p) { return *this->list[p]; }
Intersection hit();
};