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

namespace Lamp{

//------------------------------------------------------------------------------
/**
 * 可視フラグ
 */
class Visibility{
public:
	//--------------------------------------------------------------------------
	/// 見えない
	static const Visibility invisible;

	/// 解らない
	static const Visibility understand;

	/// 見える
	static const Visibility visible;

	//--------------------------------------------------------------------------
	/**
	 * コンストラクタ
	 */
	Visibility() : flag_(visibleValue){}

	/**
	 * コピーコンストラクタ
	 * @param copy コピー元オブジェクト
	 */
	inline Visibility(const Visibility& copy) : flag_(copy.flag_){}

	/**
	 * 代入コピー
	 * @param copy コピー元オブジェクト
	 */
	inline void operator =(const Visibility& copy){ flag_ = copy.flag_; }

	//--------------------------------------------------------------------------
	/**
	 * 同じかどうか
	 * @param target 比較対象
	 * @return 同じ値であればtrueを返す
	 */
	inline bool operator ==(const Visibility& target) const{
		return (flag_ == target.flag_);
	}

	/**
	 * 同じでないかどうか
	 * @param target 比較対象
	 * @return 同じでない値であればtrueを返す
	 */
	inline bool operator !=(const Visibility& target) const{
		return (flag_ != target.flag_);
	}

	//--------------------------------------------------------------------------

private:
	// コンストラクタ
	Visibility(char flag){ flag_ = flag; }

	// フラグ
	char flag_;
	// 見えないの値
	static const char invisibleValue = 0;
	// 解らないの値
	static const char understandValue = 1;
	// 見えるの値
	static const char visibleValue = 3;
};

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