Advertisement
Guest User

Untitled

a guest
May 29th, 2015
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. #pragma once
  2.  
  3. #include <utility>
  4.  
  5. #include "tiles.h"
  6. #include "Graph/AStar.hpp"
  7.  
  8. typedef std::pair<unsigned int, unsigned int> PositionType;
  9. typedef unsigned int CostType;
  10.  
  11. class MapGraphAdapter : public Graph::GraphAdapter<Tiles, PositionType, CostType> {
  12.     public:
  13.         MapGraphAdapter(Tiles& graph) : GraphAdapter(graph) {
  14.         }
  15.  
  16.         bool isAvailable(const PositionType& position) const {
  17.             bool isOnMap;
  18.             bool isAvailable = false;
  19.  
  20.             // check if positions is 'on' our map
  21.             isOnMap = (position.first < _graph.shape()[0] && position.second < _graph.shape()[1]);
  22.  
  23.             // ?
  24.         }
  25. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement