Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# Visibility.h

Go to the documentation of this file.

    00001 //------------------------------------------------------------------------------
    00002 // Lamp : Open source game middleware
    00003 // Copyright (C) 2004  Junpei Ohtani ( Email : junpee@users.sourceforge.jp )
    00004 //
    00005 // This library is free software; you can redistribute it and/or
    00006 // modify it under the terms of the GNU Lesser General Public
    00007 // License as published by the Free Software Foundation; either
    00008 // version 2.1 of the License, or (at your option) any later version.
    00009 //
    00010 // This library is distributed in the hope that it will be useful,
    00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00013 // Lesser General Public License for more details.
    00014 //
    00015 // You should have received a copy of the GNU Lesser General Public
    00016 // License along with this library; if not, write to the Free Software
    00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    00018 //------------------------------------------------------------------------------
    00019
    00020 /** @file
    00021  * 可視フラグヘッダ
    00022  * @author Junpee
    00023  */
    00024
    00025 #ifndef VISIBILITY_H_
    00026 #define VISIBILITY_H_
    00027
    00028 namespace Lamp{
    00029
    00030 //------------------------------------------------------------------------------
    00031 /**
    00032  * 可視フラグ
    00033  */
    00034 class Visibility{
    00035 public:
    00036     //--------------------------------------------------------------------------
    00037     /// 見えない
    00038     static const Visibility invisible;
    00039
    00040     /// 解らない
    00041     static const Visibility understand;
    00042
    00043     /// 見える
    00044     static const Visibility visible;
    00045
    00046     //--------------------------------------------------------------------------
    00047     /**
    00048      * コンストラクタ
    00049      */
    00050     Visibility() : flag_(visibleValue){}
    00051
    00052     /**
    00053      * コピーコンストラクタ
    00054      * @param copy コピー元オブジェクト
    00055      */
    00056     inline Visibility(const Visibility& copy) : flag_(copy.flag_){}
    00057
    00058     /**
    00059      * 代入コピー
    00060      * @param copy コピー元オブジェクト
    00061      */
    00062     inline void operator =(const Visibility& copy){ flag_ = copy.flag_; }
    00063
    00064     //--------------------------------------------------------------------------
    00065     /**
    00066      * 同じかどうか
    00067      * @param target 比較対象
    00068      * @return 同じ値であればtrueを返す
    00069      */
    00070     inline bool operator ==(const Visibility& target) const{
    00071         return (flag_ == target.flag_);
    00072     }
    00073
    00074     /**
    00075      * 同じでないかどうか
    00076      * @param target 比較対象
    00077      * @return 同じでない値であればtrueを返す
    00078      */
    00079     inline bool operator !=(const Visibility& target) const{
    00080         return (flag_ != target.flag_);
    00081     }
    00082
    00083     //--------------------------------------------------------------------------
    00084
    00085 private:
    00086     // コンストラクタ
    00087     Visibility(char flag){ flag_ = flag; }
    00088
    00089     // フラグ
    00090     char flag_;
    00091     // 見えないの値
    00092     static const char invisibleValue = 0;
    00093     // 解らないの値
    00094     static const char understandValue = 1;
    00095     // 見えるの値
    00096     static const char visibleValue = 3;
    00097 };
    00098
    00099 //------------------------------------------------------------------------------
    00100 } // End of namespace Lamp
    00101 #endif // End of VISIBILITY_H_
    00102 //------------------------------------------------------------------------------