✨ 支持通过三个新函数GetAdjacentTranslatePos、GetAdjacentDiagonalsPos、GetAdjacentPos获取上下左右及对角线最多八个方向的位置
This commit is contained in:
parent
535e90ca61
commit
ce77f513a4
|
@ -114,7 +114,7 @@ func (slf *DistributionPattern[Item]) buildRelationships(pos int, item Item) {
|
||||||
slf.links[pos] = links
|
slf.links[pos] = links
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tp := range g2d.GetAdjacentCoordinatesWithPos(slf.matrix, slf.width, pos) {
|
for _, tp := range g2d.GetAdjacentTranslatePos(slf.matrix, slf.width, pos) {
|
||||||
target := slf.matrix[tp]
|
target := slf.matrix[tp]
|
||||||
if _, exist := links[tp]; exist || !slf.sameKindVerifyHandle(item, target) {
|
if _, exist := links[tp]; exist || !slf.sameKindVerifyHandle(item, target) {
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue