22 #ifndef FIFE_MODEL_GRIDS_SQUAREGRID_H
23 #define FIFE_MODEL_GRIDS_SQUAREGRID_H
33 #include "util/base/fife_stdint.h"
38 class SquareGrid:
public CellGrid {
40 SquareGrid(
bool allow_diagonals=
true);
41 virtual ~SquareGrid();
43 const std::string& getType()
const;
44 const std::string& getName()
const;
45 bool isAccessible(
const ModelCoordinate& curpos,
const ModelCoordinate& target);
46 double getAdjacentCost(
const ModelCoordinate& curpos,
const ModelCoordinate& target);
47 uint32_t getCellSideCount()
const {
return 4; }
48 ExactModelCoordinate toMapCoordinates(
const ExactModelCoordinate& layer_coords);
49 ModelCoordinate toLayerCoordinates(
const ExactModelCoordinate& map_coord);
50 ExactModelCoordinate toExactLayerCoordinates(
const ExactModelCoordinate& map_coord);
51 void getVertices(std::vector<ExactModelCoordinate>& vtx,
const ModelCoordinate& cell);
55 bool isAccessibleDiagonal(
const ModelCoordinate& curpos,
const ModelCoordinate& target);
credit to phoku for his NodeDisplay example which the visitor code is adapted from ( he coded the qua...