<pre name="code" class="cpp">//
// GridPath.h
// Paopao
//
// Created by Vincent on 14-6-8.
// Copyright (c) 2014年 61games. All rights reserved.
//
#ifndef Paopao_GridPath_h
#define Paopao_GridPath_h
#include <stdio.h>
#include <iostream>
#include <vector>
#include <map>
#include <stdint.h>
typedef uint32_t GPoint;
#define geop(x, y) (x << 16 | y & 0xffff)
#define geop_x(p) (p >> 16)
#define geop_y(p) (p & 0xffff)
typedef std::map<GPoint, std::vector<int> > grid_path_map;
typedef bool (*check_effective_fn)(int, int);
// 生成可移动网格
void generate_grids(int x, int y, int r, grid_path_map& move_path, check_effective_fn fn);
#endif
//
// GridPath.cpp
// Paopao
//
// Created by Vincent on 14-6-8.
// Copyright (c) 2014年 61games. All righ