本文整理汇总了C++中Position::Copy方法的典型用法代码示例。如果您正苦于以下问题:C++ Position::Copy方法的具体用法?C++ Position::Copy怎么用?C++ Position::Copy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Position
的用法示例。
在下文中一共展示了Position::Copy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MakeNormalWall
void Map::MakeNormalWall(Position* position, int wallID)
{
walls_[position->y_][position->x_][position->facing_] = wallID;
passibility_[position->y_][position->x_][position->facing_] = false;
Position positionAhead;
positionAhead.Copy(position->GetPositionAheadOfThis(1));
if (positionAhead.InBounds(0, 0, width_, height_))
{
int newFacing = (position->facing_ + 2) % 4;
walls_[positionAhead.y_][positionAhead.x_][newFacing] = wallID;
passibility_[positionAhead.y_][positionAhead.x_][newFacing] = false;
}
# if 0
Position* positionAhead = position->GetPositionAheadOfThis(1);
if (
(positionAhead->x_ >= 0x0 && positionAhead->x_ < width_) &&
(positionAhead->y_ >= 0x0 && positionAhead->y_ < height_))
{
int newFacing = (position->facing_ + 2) % 4;
walls_[positionAhead->y_][positionAhead->x_][newFacing] = wallID;
passibility_[positionAhead->y_][positionAhead->x_][newFacing] = false;
}
#endif
}
示例2: RemoveWall
void Map::RemoveWall(Position* position)
{
walls_[position->y_][position->x_][position->facing_] = 0;
passibility_[position->y_][position->x_][position->facing_] = true;
Position positionAhead;
positionAhead.Copy(position->GetPositionAheadOfThis(1));
if (positionAhead.InBounds(0, 0, width_, height_))
{
int newFacing = (position->facing_ + 2) % 4;
walls_[positionAhead.y_][positionAhead.x_][newFacing] = 0;
passibility_[positionAhead.y_][positionAhead.x_][newFacing] = true;
}
}