#pragma once

#include "interest.h"

//##########################################################################
//######################    CollisionOrigin    #############################
//##########################################################################

class CollisionOrigin : public InterestOrigin
{
	friend class CollisionOrigin__MovingEntityIterator;

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Interest Manager support
//
public:
	typedef CollisionOrigin__MovingEntityIterator MovingEntityIterator;

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Construction, Destruction, Testing
//
public:
	CollisionOrigin(InterestZoneID interest_zone_ID);
	~CollisionOrigin();

	Logical TestInstance() const;

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Interest Manager support
//
protected:
	void AddInterestingEntity(Entity *interesting_entity);
	void RemoveUninterestingEntity(Entity *uninteresting_entity);
	void RemoveUninterestingEntities();

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Private data
//
private:
	SChainOf<Entity*> movingEntitySocket;
};

//~~~~~~~~~~~~~~~~~~~~ CollisionOrigin__MovingEntityIterator ~~~~~~~~~~~~~~~

class CollisionOrigin__MovingEntityIterator : public SChainIteratorOf<Entity*>
{
public:
	CollisionOrigin__MovingEntityIterator(CollisionOrigin *collision_origin);
	~CollisionOrigin__MovingEntityIterator();
};
