|
dl
|
类 | |
| class | MapLimit |
| 地图限制器(x轴为环状) 更多... | |
类型定义 | |
| using | FnDiffusionCheck = std::function<bool(const PointU& xy)> |
| using | FnDiffusionCb = std::function<void(unsigned, const std::list<PointU>& xy)> |
函数 | |
| void | Clamp (const Size &size, PointU &xy) |
| 限制到大小内 | |
| bool | Clamp (const Size &size, Point xy, PointU &out_xy) |
| 限制到大小内 | |
| unsigned | DistancePow2NoCheck (const Size &size, const PointU &a, const PointU &b) |
| 返回 距离,x轴为环形 | |
| unsigned | Distance (const Size &size, const PointU &a, const PointU &b) |
| 返回 距离,x轴为环形 | |
| std::vector< PointU > | GetCircle (const Size &size, const PointU &xy, unsigned rad) |
| 返回圆形范围的节点,x轴为环形 | |
| std::vector< PointU > | Diffusion (const Size &size, const PointU &xy, unsigned count, FnDiffusionCheck func_valid, FnDiffusionCb func_cb) |
| 扩散遍历 | |
| using dl::Math::RingX::FnDiffusionCb = std::function<void(unsigned, const std::list<PointU>& xy)> |
| using dl::Math::RingX::FnDiffusionCheck = std::function<bool(const PointU& xy)> |
| std::vector< PointU > dl::Math::RingX::Diffusion | ( | const Size & | size, |
| const PointU & | xy, | ||
| unsigned | count, | ||
| FnDiffusionCheck | func_valid, | ||
| FnDiffusionCb | func_cb ) |
扩散遍历
| [in] | size | 地图大小(暂不能超过65535) |
| [in] | xy | 中心点 |
| [in] | count | 扩展次数 |
| [in] | func_valid | 返回false表示此节点不扩散 |
| [in] | func_cb | 每轮扩散后执行的回调 |
| 返回遍历到的格子,按顺序(xy无效返回0) |