#pragma once
#include "staticscenenode.h"
#include "Item_Common.h"

class cDropItemSceneNodeParam : public cStaticSceneNodeParam
{
public:
	cDropItemSceneNodeParam();

public:
	/// Drop 좌표
	NiPoint2		mDropStartPos;
	NiPoint2		mDropEndPos;

	/// 서버 관리용 인덱스
	unsigned long	mDropIndex;

	/// 
	unsigned long	mOwner[ MAX_OWNER ];
	unsigned long	mTimeToOwn;
};

inline cDropItemSceneNodeParam::cDropItemSceneNodeParam()
: mDropIndex(UINT_MAX)
, mDropStartPos(0.0f, 0.0f)
, mDropEndPos(0.0f, 0.0f)
{
}


class cEffectSceneNode;

class cDropItemSceneNode : public cManagedStaticSceneNode
{
	friend class cSceneManager;

public:
	/// 처리
	//virtual void OnProcess( unsigned long time );

	inline unsigned long GetDropIndex() { return mDropIndex; }

	bool IsHeroOwner();

	void ClearEffect();

protected:
	cDropItemSceneNode( eType type = eDROPITEM );
	virtual ~cDropItemSceneNode();

	/// 초기화
	virtual bool Init( const cDropItemSceneNodeParam& param );
	virtual void OnProcess( unsigned long deltaTime, unsigned long accumTime );

protected:
	/// 드랍 아이템 관리자용 인덱스
	unsigned long mDropIndex;

	/// Drop 목적지 위치(몬스터 위치, 플레이어 위치)
	NiPoint2	mDropStartPos;
	NiPoint2	mDropEndPos;

	unsigned long mOwner[MAX_OWNER];
	unsigned long mTimeToOwn;


	unsigned long		mEffectIdxByManager;
	cEffectSceneNode*	mOwnerEffect;
};