bool GameMap::newMove(Coordinate *orig, Coordinate *dest){ Tile *orig_tile = getTileAtPos(orig); Tile *dest_tile = getTileAtPos(dest); if (orig_tile != nullptr && dest_tile != nullptr){ q.push(new Move(orig_tile, dest_tile, dest)); return true; } return false; }
bool GameMap::newPickUp(Coordinate *pos){ Tile *tile = getTileAtPos(pos); if (tile != nullptr){ q.push(new Pickup(tile)); return true; } return false; }
Ogre::Vector2 OgreDetourTileCache::getTileAtPos(const Ogre::Vector3 pos) { float position[3]; OgreRecast::OgreVect3ToFloatA(pos, position); int tx; int ty; getTileAtPos(position, tx, ty); return Ogre::Vector2(tx, ty); }
bool OgreDetourTileCache::isWithinBounds(Ogre::Vector3 pos) { Ogre::Vector2 tpos = getTileAtPos(pos); return isWithinBounds((int)tpos.x, (int)tpos.y); }