Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
LifeGameViewOnCurses Class Reference

ライフゲームの表示を管理するクラス. More...

#include <LifeGameViewOnCurses.h>

Inheritance diagram for LifeGameViewOnCurses:
Observer

List of all members.

Public Member Functions

 LifeGameViewOnCurses ()
 コンストラクタ.
virtual ~LifeGameViewOnCurses ()
 デストラクタ.
long getColMax ()
 座標位置 横方向の最大.
long getRowMax ()
 座標位置 縦方向の最大.
long getCol ()
 カーソルの位置(x座標)を取得.
long getRow ()
 カーソルの位置(y座標)を取得.
bool draw (int i_iCol, int i_iRow, CellAttribute::CELL_STATE i_eState)
 現カーソル上にセルの状態を描画.
char getCommand () const
 ユーザーから入力されたコマンドを取得.
void moveToUpper ()
 カーソルを上へ移動.
void moveToLower ()
 カーソルを下へ移動.
void moveToRight ()
 カーソルを右へ移動.
void moveToLeft ()
 カーソルを左へ移動.
bool update (Information *i_pcInformation)
 Subjectから通知を受信.

Private Member Functions

void initDisplay ()
 curses初期化.
bool recieveState (MatrixCellAttribute *i_pcMatrixCellAttribute)
 MatrixCellの状態を受け取る.

Private Attributes

WINDOW * m_pWindow
 cursesのウィンドウ.

Static Private Attributes

static const int m_piDispCharacter [CellAttribute::CELL_STATE_MAX] = { ' ', '*', }
 表示する文字の定義.

Detailed Description

ライフゲームの表示を管理するクラス.

Note:
UNIX環境のcursesで表示する事を想定している.
以下URLを参考にした.
http://www.kis-lab.com/serikashiki/man/ncurses.html

Constructor & Destructor Documentation

LifeGameViewOnCurses::LifeGameViewOnCurses ( ) [inline]

コンストラクタ.

virtual LifeGameViewOnCurses::~LifeGameViewOnCurses ( ) [inline, virtual]

デストラクタ.


Member Function Documentation

bool LifeGameViewOnCurses::draw ( int  i_iCol,
int  i_iRow,
CellAttribute::CELL_STATE  i_eState 
)

現カーソル上にセルの状態を描画.

Parameters:
CellAttribute::CELL_STATEi_eState セルの状態.
Returns:
成功/失敗.
long LifeGameViewOnCurses::getCol ( ) [inline]

カーソルの位置(x座標)を取得.

long LifeGameViewOnCurses::getColMax ( ) [inline]

座標位置 横方向の最大.

Note:
curses ライブラリ.
char LifeGameViewOnCurses::getCommand ( ) const [inline]

ユーザーから入力されたコマンドを取得.

Parameters:
なし.
Returns:
入力されたコマンド.
long LifeGameViewOnCurses::getRow ( ) [inline]

カーソルの位置(y座標)を取得.

long LifeGameViewOnCurses::getRowMax ( ) [inline]

座標位置 縦方向の最大.

Note:
curses ライブラリ.
void LifeGameViewOnCurses::initDisplay ( ) [private]

curses初期化.

Parameters:
なし.
Returns:
なし.
void LifeGameViewOnCurses::moveToLeft ( )

カーソルを左へ移動.

Parameters:
なし.
Returns:
なし.
void LifeGameViewOnCurses::moveToLower ( )

カーソルを下へ移動.

Parameters:
なし.
Returns:
なし.
void LifeGameViewOnCurses::moveToRight ( )

カーソルを右へ移動.

Parameters:
なし.
Returns:
なし.
void LifeGameViewOnCurses::moveToUpper ( )

カーソルを上へ移動.

Parameters:
なし.
Returns:
なし.
bool LifeGameViewOnCurses::recieveState ( MatrixCellAttribute i_pcMatrixCellAttribute) [inline, private]

MatrixCellの状態を受け取る.

Parameters:
MatrixCellAttribute*i_pcMatrixCellAttribute MatrixCellの状態.
Returns:
結果.
Return values:
true成功.
false失敗.
bool LifeGameViewOnCurses::update ( Information i_pcInformation) [inline, virtual]

Subjectから通知を受信.

Parameters:
Information*i_pcInformation MatrixCellの属性.
Returns:
成功/失敗.
Note:
MatrixCellAttributeのインスタンスが渡されることを想定している.

Implements Observer.


Member Data Documentation

const int LifeGameViewOnCurses::m_piDispCharacter = { ' ', '*', } [static, private]

表示する文字の定義.

cursesのウィンドウ.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Enumerations Enumerator Defines