#include "Chunk.h"
#include <math.h>
#include "iostream"

Chunk::Chunk()
{

}
Chunk::Chunk(bool ranGen)
{
    if(ranGen)
    {
        unsigned int numbOfObj = rand()%30;
        std::cout<<" number:"<< numbOfObj <<". ";
        for (unsigned int i = 0; i<numbOfObj;i++)
        {
            addAstroObject(new AstronomicalObject(rand()%320,rand()%320));
            addAstroObject(new Planet(rand()%320,rand()%320));
            m_listeContenu.push_back(new Planet(rand()%320,rand()%320));
        }
    }
}

Chunk::~Chunk()
{
    for (unsigned int i = 0;i<m_listeContenu.size();i++)
    {
        delete m_listeContenu[i];
    }
}
void Chunk::addAstroObject(AstronomicalObject * toBeAdded)
{
    m_listeContenu.push_back(toBeAdded);
}
