本文整理汇总了C++中mazewarinstance::Ptr::yPeek方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::yPeek方法的具体用法?C++ Ptr::yPeek怎么用?C++ Ptr::yPeek使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mazewarinstance::Ptr
的用法示例。
在下文中一共展示了Ptr::yPeek方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoViewUpdate
void DoViewUpdate()
{
mws_render_wipe(M->state);
mws_render_draw(M->state);
/* XXX: Hack. I don't want to deal with setting updateView in
* the mws_* methods, thus just always update view, even
* if it is unnecessary.
*/
updateView = TRUE;
if (updateView) { /* paint the screen */
/* XXX: I don't think this is necessary anymore as the
* mws_render_* functions take care of it.
ShowPosition(MY_X_LOC, MY_Y_LOC, MY_DIR);
*/
if (M->peeking())
ShowView(M->xPeek(), M->yPeek(), M->dirPeek());
else
ShowView(MY_X_LOC, MY_Y_LOC, MY_DIR);
updateView = FALSE;
}
}
示例2: DoViewUpdate
void DoViewUpdate()
{
if (updateView) { /* paint the screen */
ShowPosition(MY_X_LOC, MY_Y_LOC, MY_DIR);
if (M->peeking())
ShowView(M->xPeek(), M->yPeek(), M->dirPeek());
else
ShowView(MY_X_LOC, MY_Y_LOC, MY_DIR);
updateView = FALSE;
}
}
示例3: peekRight
void peekRight()
{
M->xPeekIs(MY_X_LOC);
M->yPeekIs(MY_Y_LOC);
M->dirPeekIs(MY_DIR);
switch(MY_DIR) {
case NORTH: if (!M->maze_[MY_X_LOC+1][MY_Y_LOC]) {
M->xPeekIs(MY_X_LOC + 1);
M->dirPeekIs(EAST);
}
break;
case SOUTH: if (!M->maze_[MY_X_LOC-1][MY_Y_LOC]) {
M->xPeekIs(MY_X_LOC - 1);
M->dirPeekIs(WEST);
}
break;
case EAST: if (!M->maze_[MY_X_LOC][MY_Y_LOC+1]) {
M->yPeekIs(MY_Y_LOC + 1);
M->dirPeekIs(SOUTH);
}
break;
case WEST: if (!M->maze_[MY_X_LOC][MY_Y_LOC-1]) {
M->yPeekIs(MY_Y_LOC - 1);
M->dirPeekIs(NORTH);
}
break;
default:
MWError("bad direction in PeekRight");
}
/* if any change, display the new view without moving! */
if ((M->xPeek() != MY_X_LOC) || (M->yPeek() != MY_Y_LOC)) {
M->peekingIs(TRUE);
updateView = TRUE;
}
}