//------------------------------------------------------------------------------
// 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_SEQUENCE_H_
#define TRANSLATION_SEQUENCE_H_

namespace LampForMaya{

//------------------------------------------------------------------------------
/**
 * 変換シーケンス
 */
class TranslationSequence{
public:
	/**
	 * コンストラクタ
	 */
	TranslationSequence();

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

	/**
	 * 分析
	 * @param object 分析するオブジェクト
	 * @return シーケンスがあればtrue
	 */
	virtual bool analyze(const MObject& object);

	/**
	 * シーケンスを持つか
	 * @return シーケンスを持つならtrue
	 */
	virtual bool hasSequence() const{ return hasSequence_; }

	/**
	 * シーケンス数の取得
	 * @return シーケンス数
	 */
	virtual int getSequenceCount() const{ return sequenceCount_; }

	/**
	 * 開始時間の取得
	 * @param sequence シーケンス
	 * @return 開始時間
	 */
	virtual int getStartTime(int sequence){
		Assert(startTime_ != NULL);
		Assert(sequence >= 0);
		Assert(sequence < sequenceCount_);
		return startTime_[sequence];
	}

	/**
	 * 終了時間の取得
	 * @param sequence シーケンス
	 * @return 終了時間
	 */
	virtual int getEndTime(int sequence){
		Assert(endTime_ != NULL);
		Assert(sequence >= 0);
		Assert(sequence < sequenceCount_);
		return endTime_[sequence];
	}

	/**
	 * ループの取得
	 * @param sequence シーケンス
	 * @return ループ
	 */
	virtual bool isLooped(int sequence){
		Assert(looped_ != NULL);
		Assert(sequence >= 0);
		Assert(sequence < sequenceCount_);
		return looped_[sequence];
	}

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

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

	// シーケンス数
	int sequenceCount_;
	// 開始時間
	int* startTime_;
	// 終了時間
	int* endTime_;
	// ループ
	bool* looped_;
	// シーケンスを持つか
	bool hasSequence_;
};

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

