/* ==========================================================================
* 파    일 : NoteManager.h
* 목    적 : 쪽지 관리자
* 작 성 자 : 김가람
* 작 성 일 : 2008-10-31
* 주의사항 :
*===========================================================================*/
#pragma once

class cNoteManager
{
	static cNoteManager*	mpSingleton;

public:
	cNoteManager();
	~cNoteManager();

	/// 
	bool AddNote( unsigned long idx, TB_NOTE* note );
	bool DeleteNote( unsigned long idx, unsigned long noteIdx );
	bool SendNoteList( cPlayer* player );

	/// 플레이어의 쪽지 관리자 삽입
	bool AddPlayerNoteMap( unsigned long idx );
	void DeletePlayerNoteMap( unsigned long idx );

private:
	void Release();

public:
	static cNoteManager* Get();

private:
	/// 쪽지 관리(플레이어인덱스, 쪽지맵)
	typedef tPointerHashMap<unsigned long, void*> cNoteHashMap;
	cNoteHashMap mNoteHashMap;

	/// 각 유저의 쪽지(TB_NOTE)
	typedef tPointerHashMap<unsigned long, void*> cPlayerNoteMap;
};

inline cNoteManager* cNoteManager::Get()
{
	return mpSingleton;
}

#define NOTEMAN cNoteManager::Get()