本文整理汇总了C++中Pos::getY方法的典型用法代码示例。如果您正苦于以下问题:C++ Pos::getY方法的具体用法?C++ Pos::getY怎么用?C++ Pos::getY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pos
的用法示例。
在下文中一共展示了Pos::getY方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fillAllPossible
int Preprocessor::fillAllPossible(Sudokufield& field){
int anz( onlyOnePossible.size());
while(!onlyOnePossible.empty()){
Pos curr = *(onlyOnePossible.begin());
onlyOnePossible.erase(onlyOnePossible.begin());
field(curr.getX(), curr.getY()) = curr.getValue();
deleteDoubleCell(curr.getX(), curr.getY(), curr.getValue(), field);
deleteDoubleColAndRow(curr.getX(), curr.getY(), curr.getValue(), field);
deleteDoubleSquare(curr.getX(), curr.getY(), curr.getValue(), field);
}
return anz;
}
示例2: if
void Solver::DeepSearch::backtrack(uint tile){
Pos<uint> newPos = positions[tile];
uint x, y;
for(x=0; x<gameField.getTile(tile).getSizeX(); ++x)
for(y=0; y<gameField.getTile(tile).getSizeY(); ++y){
if(gameField.getTile(tile).getField(x, y) == true){
if(currentValue[newPos.getX() + x][newPos.getY() + y] == 0){
currentValue[newPos.getX()+ x][newPos.getY() + y] = gameField.getField().getMod()-1;
heuristicValue++;
}else if (currentValue[newPos.getX() + x][newPos.getY() + y] == 1){
currentValue[newPos.getX() + x][newPos.getY()+ y] = 0;
heuristicValue -= gameField.getField().getMod() -1;
} else {
currentValue[newPos.getX()+ x][newPos.getY() + y]--;
heuristicValue++;
}
}
}
}
示例3: selectNeighbor
int simplehero::selectNeighbor(GraphMap* map, int cur_x, int cur_y)
{
// printf("Selecting neighbor\n");
int x, y, a, b;
Pos* goal = findGoal(map, cur_x, cur_y);
int g;
if(goal == 0)
{
printf("Couldn't find goal\n");
return 0;
}
g = map->getVertex(goal->getX(), goal->getY());
int toGo = BFSearch(map, cur_x, cur_y, g);
//printf("Done searching\n");
if(toGo == -1)
{
// printf("No target found\n");
delete goal;
return 0;
}
/* if(p == 0 || p[1]->getX() < 0)
{
printf("ERRRORRORROR\n");
goal = findGoal(map, cur_x, cur_y);
toGo = BFSearch(map ,cur_x, cur_y, goal);
}*/
map->getPosition(toGo, x, y);
for(int i = 0; i < map->getNumNeighbors(cur_x, cur_y); i++)
{
map->getNeighbor(cur_x, cur_y, i, a, b);
if(x == a && y == b)
{
delete goal;
return i;
}
}
printf("Shouldn't get here");
return 0;
}
示例4: getIntForPos
int Preprocessor::getIntForPos(const Pos& t){
return varToNumber[t.getX()][t.getY()][t];
}
示例5: calcDist
/**
@param p1: Die Koordinaten der ersten Position
@param p2: Die Koordinaten der zweiten Position
@return Die Distance Zwischen den 2 Koordinaten
*/
float Pos::calcDist(const Pos& p1, const Pos& p2){
return calcDist(p1.getX(), p1.getY(), p2.getX(), p2.getY());
}