#ifndef BODY_HPP
#define BODY_HPP

#include <vector>
#include <string>

namespace nbody {
	using namespace std;

	static const double timestep = 1.0;

	typedef struct Derivative_ {
		double dx[3];
		double dv[3];
	} Derivative;

	typedef struct Body_ {
		unsigned long id;
		double position[3];
		double velocity[3];
		double acceleration[3];
		double mass;
		int refinement;
	} Body;

	void resetAcceleration(Body& body);
	Derivative evaluate(Body body, double dt, Derivative d);
	void integrate(Body& body);
	void accumulateForceOntoBody(Body& to, Body from);
	bool valid(Body body);
	void printBody(int parallelId, Body body);
	void printBodies(int parallelId, vector<Body> bodies);
	bool valid(vector<Body> bodies);
	vector<Body> dubinskiParse(string filename);
}

#endif
