#pragma once

#include "stdafx.h"
#include "MW4GameEd.h"
#include <ElementRenderer\LineCloudElement.hpp>
#include <MW4\MW4Headers.hpp>

class CSelectionNode : 
	public Plug
{
public:

	CSelectionNode() :
		Plug(Plug::DefaultData)
	{
		selectedEntity = NULL;
		Point_Count=24;
	}

	CSelectionNode(Adept::Entity* selection) :
		Plug(Plug::DefaultData),
		selectedEntity(selection)
	{
		Check_Object(selectedEntity);
		collisionMask = selectedEntity->GetCollisionMask();
		Point_Count=24;
	}

	~CSelectionNode();

	Adept::Entity
		*selectedEntity;
	Entity::CollisionMask 
		collisionMask;
	ElementRenderer::LineCloudElement*
		lineCloud;
	Stuff::Point3D
		Point_Data[24];
	Stuff::RGBAColor
		Color_Data[24];
	unsigned 
		Point_Count;
};

class CSelectionList :
	public Plug
{
public:

	CSelectionList();
	~CSelectionList();

	void
		AddSelection(Adept::Entity* selection);

	void
		RemoveSelection(
			Adept::Entity* selection,
			bool restore_collision = true
		);
	void
		ClearSelectionList(bool restore_collision = true);

	int 
		CSelectionList::GetSelectionCount();

	CSelectionNode
		*FindSelection(Adept::Entity *entity);

	void
		RemoveCollision();

	void 
		RestoreCollision();

	Stuff::ChainOf<CSelectionNode *> 
		selectionList;

	static CSelectionList
		*Instance;
};
