//------------------------------------------------------------------------------
// 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 RANDOM_RENAMER_H_
#define RANDOM_RENAMER_H_

#include <Core/Renamer/Renamer.h>
#include <Core/Utility/Random.h>

namespace Lamp{

//------------------------------------------------------------------------------
/**
 * ランダムリネーマ
 */
class RandomRenamer : public Renamer{
public:
	/**
	 * コンストラクタ
	 */
	RandomRenamer();

	/**
	 * コンストラクタ
	 * @param seed ランダムの種
	 */
	RandomRenamer(u_int seed);

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

	/**
	 * リネーム
	 * @param database データベース
	 * @param sourceName 元となる名前
	 * @return 重複していない名前
	 */
	virtual String rename(Database* database, const String& sourceName);

	/**
	 * ランダムの種設定
	 * @param seed ランダムの種
	 */
	virtual void setSeed(u_int seed){ random_.setSeed(seed); }

protected:
	/// ランダム
	Random random_;

};

//------------------------------------------------------------------------------
} // End of namespace Lamp
#endif // End of RANDOM_RENAMER_H_
//------------------------------------------------------------------------------

