//------------------------------------------------------------------------------
// Lamp : Open source game middleware
// Copyright (C) 2004  Junpei Ohtani ( Email : junpee@users.sourceforge.jp )
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//------------------------------------------------------------------------------

/** @file
 * 変換ピクチャマネージャヘッダ
 * @author Junpee
 */

#ifndef TRANSLATION_PICTURE_MANAGER_H_
#define TRANSLATION_PICTURE_MANAGER_H_

#include <Core/Container/HashMap.h>
#include <Core/Container/ArrayList.h>
#include <Translator/Picture/TranslationPicture.h>

namespace LampForMaya{

class TranslationTextureManager;

//------------------------------------------------------------------------------
/**
 * 変換ピクチャマネージャ
 */
class TranslationPictureManager{
public:
	/**
	 * コンストラクタ
	 */
	TranslationPictureManager();

	/**
	 * デストラクタ
	 */
	virtual ~TranslationPictureManager();

	/**
	 * ピクチャの収集
	 * @return 成功すればtrue
	 */
	virtual bool collectPictures(TranslationTextureManager* textureManager);

	/**
	 * Lampへの変換
	 * @param scene 変換先シーン
	 * @return 成功すればtrue
	 */
	virtual bool convertToLamp(Scene* scene);

	/**
	 * クリア
	 * @return 削除したオブジェクト数
	 */
	virtual int clear();

	/**
	 * ピクチャ数の取得
	 * @return ピクチャ数
	 */
	virtual int getCount(){ return array_.getCount(); }

	/**
	 * ピクチャの取得
	 * @param index ピクチャのインデクス
	 * @return ピクチャ
	 */
	virtual TranslationPicture* get(int index){ return array_.get(index); }

	/**
	 * ピクチャの検索
	 * @param name 検索するピクチャ名
	 * @return ピクチャ
	 */
	virtual TranslationPicture* search(String name){
		return database_.get(name);
	}

private:
	// コピーコンストラクタの隠蔽
	TranslationPictureManager(const TranslationPictureManager& copy);

	// 代入コピーの隠蔽
	void operator =(const TranslationPictureManager& copy);

	// ピクチャデータベース
	Lamp::HashMap<String, TranslationPicture*> database_;
	// ピクチャ配列
	ArrayList<TranslationPicture*> array_;

};

//------------------------------------------------------------------------------
} // End of namespace LampForMaya
#endif // End of TRANSLATION_PICTURE_MANAGER_H_
//------------------------------------------------------------------------------
