#ifndef BODY_HPP
#define BODY_HPP

namespace nbody {
	static const double timestep = 1.0;
	class Derivative;

	class Body {
		friend class Box;
		friend class Node;
		friend class MpiBodyComm;
	protected:

		Derivative evaluate(double dt, Derivative d);
	public:
		double position[3];
		double velocity[3];
		double acceleration[3];
		double mass;
		int refinement;

		Body();
		Body(double positionX, double positionY, double positionZ);
		Body(double positionX, double positionY, double positionZ, double velocityX, double velocityY, double velocityZ);
		Body(double positionX, double positionY, double positionZ, double weight);
		Body(double positionX, double positionY, double positionZ, double velocityX, double velocityY, double velocityZ, double weight);
		virtual ~Body();
		virtual void resetAcceleration();
		virtual void integrate();
		virtual void accumulateForceOnto(Body& from);
		virtual bool valid();
		virtual void print();
	};
}

#endif
