#include "Salamander.h"
#include "CollisionKey.h"

namespace Salamander
{

CollisionKey::CollisionKey(Body* body1, Body* body2)
{
	body1_ = (body1 < body2) ? body1 : body2;
	body2_ = (body1 < body2) ? body2 : body1;
}

CollisionKey::~CollisionKey()
{
}

// so that we can use std::map
bool CollisionKey::operator < (const CollisionKey& c) const
{
	if (body1_ < c.body1_)
		return true;

	if (body1_ == c.body1_ && body2_ < c.body2_)
		return true;

	return false;
}

}
