| 123456789101112131415161718192021222324252627 |
- package data
- import (
- "f1-game/internal/types"
- )
- func (p *MapBuildRow) GetCoverOffsetPoints(x, y int32, includeCenter bool) types.Points {
- return p.getPoints(x, y, p.CoverOddOffsets, p.CoverEvenOffsets, includeCenter)
- }
- // 获取影响坐标点
- func (p *MapBuildRow) GetAffectOffsetPoints(x, y int32, includeCenter bool) types.Points {
- return p.getPoints(x, y, p.AffectOddOffsets, p.AffectEvenOffsets, includeCenter)
- }
- // 获取影响包围坐标点
- func (p *MapBuildRow) GetAffectEdgePoints(x, y int32) types.Points {
- return p.getPoints(x, y, p.AffectEdgeOddOffsets, p.AffectEdgeEvenOffsets, false)
- }
- func (p *MapBuildRow) getPoints(x, y int32, odds, evens types.Points, includeCenter bool) types.Points {
- points := GetOffsetPoints(x, y, odds, evens)
- if includeCenter {
- points.Add(x, y)
- }
- return points
- }
|