Esempio n. 1
0
bool IMovable::checkMove(Dir direct)
{
    if (!checkMoveTime()) 
        return false;
    if (anchored)
        return false;
    if (!Rotate(direct))
        return false;
    if (!checkPassable())
    {
        return false;
    }
    return mainMove();    
};
Esempio n. 2
0
 virtual void AdjacentCost( void* node, std::vector<micropather::StateCost>* adjacent )
 {
     int currX=0, currY=0;
     convertNodeToXY( node, currX, currY );
     for ( unsigned int i=0; i<_costList.size(); ++i )
     {
         int nx = currX + (int)_costList[i].direction.x();
         int ny = currY + (int)_costList[i].direction.y();
         if ( checkPassable(nx, ny) )
         {
             micropather::StateCost stateCost = {convertXYToNode(nx, ny), _costList[i].weight};
             adjacent->push_back( stateCost );
         }
     }
 }