#include "stdafx.h"
#include "token.h"
#include "moon.h"
#include "eye.h"
#include "cosmos.h"
#include "ringforce.h"
using namespace std;
Cosmos::Cosmos()
{
_eye = new Eye();
Clear();
}
Cosmos::~Cosmos()
{
delete _eye;
_eye = NULL;
}
void Cosmos::Clear()
{
for (int iMoon = _moon.size(); iMoon--; )
{
delete _moon[iMoon];
}
_moon.clear();
_displayMoon.clear();
_firstMass = 0;
_backgroundColor = 0x000000;
_work = 20;
_increment = 1.0;
_inc = _increment / _work;
_sleep = 50;
_trail = false;
_eye->Init(Point(), 0, 0, 0, 100.0);
_eye->SetWidth(0);
_eye->SetHeight(0);
_points = 10;
_stepFunction = &Moon::Step10;
_energy = false;
_stop = false;
_autocenter = true;
_length = 0.0;
_scaleMass = 1.0;
_follow = -1;
_followMoon = NULL;
_noPerspective = false;
_t = 0.0;
_stopped = false;
}
// already parsed "".
void Cosmos::ParseApplet(Tokenizer* t)
{
Clear();
// finish parsing